--in can now refer to files that were located in a repository at some past date. For example, --in="here@{yesterday}"
This commit is contained in:
parent
e86db3d2ab
commit
a44e01c29c
8 changed files with 73 additions and 15 deletions
|
@ -11,6 +11,7 @@ import Common
|
|||
import Git
|
||||
import Git.Command
|
||||
import Git.Sha
|
||||
import Git.Types
|
||||
|
||||
import Data.Char (chr)
|
||||
|
||||
|
@ -51,6 +52,10 @@ underBase dir r = Ref $ dir ++ "/" ++ show (base r)
|
|||
fileRef :: FilePath -> Ref
|
||||
fileRef f = Ref $ ":./" ++ f
|
||||
|
||||
{- Converts a Ref to refer to the content of the Ref on a given date. -}
|
||||
dateRef :: Ref -> RefDate -> Ref
|
||||
dateRef (Ref r) (RefDate d) = Ref $ r ++ "@" ++ d
|
||||
|
||||
{- A Ref that can be used to refer to a file in the repository as it
|
||||
- appears in a given Ref. -}
|
||||
fileFromRef :: Ref -> FilePath -> Ref
|
||||
|
|
|
@ -57,6 +57,10 @@ type Branch = Ref
|
|||
type Sha = Ref
|
||||
type Tag = Ref
|
||||
|
||||
{- A date in the format described in gitrevisions. Includes the
|
||||
- braces, eg, "{yesterday}" -}
|
||||
newtype RefDate = RefDate String
|
||||
|
||||
{- Types of objects that can be stored in git. -}
|
||||
data ObjectType = BlobObject | CommitObject | TreeObject
|
||||
deriving (Eq)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue