From 3bdf2d2052f3a194b3f72500ca71867fb22e1315 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 1 Dec 2013 15:14:13 -0400 Subject: 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. --- Git/Ref.hs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'Git/Ref.hs') 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) -} -- cgit v1.2.3