add --verify

Needed for the --quiet to actually shut it up. The extra verification
this makes it do should be fine, as this is supposed to really return a
single tree's sha.
This commit is contained in:
Joey Hess 2019-05-06 16:41:01 -04:00
parent e29f07258a
commit ecdbdf6180
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38

View file

@ -143,10 +143,13 @@ delete oldvalue ref = run
, Param $ fromRef oldvalue
]
{- Gets the sha of the tree a ref uses. -}
{- Gets the sha of the tree a ref uses.
-
- The ref may be something like a branch name, and it could contain
- ":subdir" if a subtree is wanted. -}
tree :: Ref -> Repo -> IO (Maybe Sha)
tree (Ref ref) = extractSha <$$> pipeReadStrict
[ Param "rev-parse", Param "--quiet", Param ref' ]
[ Param "rev-parse", Param "--verify", Param "--quiet", Param ref' ]
where
ref' = if ":" `isInfixOf` ref
then ref