summaryrefslogtreecommitdiff
path: root/Git/Ref.hs
diff options
context:
space:
mode:
authorJoey Hess <joeyh@debian.org>2013-12-03 15:02:21 -0400
committerJoey Hess <joeyh@debian.org>2013-12-03 15:02:21 -0400
commitb1ed0aee347a88507d1530f61006cd658b57e54c (patch)
treeeb2a975663782f83e6b20d6d239447d7222de81b /Git/Ref.hs
parent7e592e1d6ed5e0b25b37215da7558c6324688d6f (diff)
parenta4f3e112954e1b785c84c339bcbd83597a89335e (diff)
downloadgit-repair-b1ed0aee347a88507d1530f61006cd658b57e54c.tar.gz
Record git-repair (1.20131203) in archive suite sid
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) -}