summaryrefslogtreecommitdiff
path: root/Git/Ref.hs
diff options
context:
space:
mode:
authorJoey Hess <joey@kitenet.net>2013-12-01 15:14:13 -0400
committerJoey Hess <joey@kitenet.net>2013-12-01 15:14:13 -0400
commit3bdf2d2052f3a194b3f72500ca71867fb22e1315 (patch)
treed4a076f7fc1ca255ded959779d99404525f7de78 /Git/Ref.hs
parent3c7357ee388795149e922d344bdbf32e1d1d5810 (diff)
downloadgit-repair-3bdf2d2052f3a194b3f72500ca71867fb22e1315.tar.gz
merge from git-annex
Note that the batchCommand stuff is not used in git-repair, so configure does not need to check for nice, ionice, and nocache, nor are they dependend on.
Diffstat (limited to 'Git/Ref.hs')
-rw-r--r--Git/Ref.hs6
1 files changed, 6 insertions, 0 deletions
diff --git a/Git/Ref.hs b/Git/Ref.hs
index 6ce1b87..0947293 100644
--- a/Git/Ref.hs
+++ b/Git/Ref.hs
@@ -10,6 +10,7 @@ module Git.Ref where
import Common
import Git
import Git.Command
+import Git.Sha
import Data.Char (chr)
@@ -105,6 +106,11 @@ matchingUniq refs repo = nubBy uniqref <$> matching refs repo
where
uniqref (a, _) (b, _) = a == b
+{- Gets the sha of the tree a ref uses. -}
+tree :: Ref -> Repo -> IO (Maybe Sha)
+tree ref = extractSha <$$> pipeReadStrict
+ [ Param "rev-parse", Param (show ref ++ ":") ]
+
{- Checks if a String is a legal git ref name.
-
- The rules for this are complex; see git-check-ref-format(1) -}