avoid git warning on first import of subdir from a remote

git rev-parse --quiet avoids "fatal: Invalid object name" when the
branch does not exist. Git.Ref.tree already returned a Maybe, so callers
already handle those cases themselves.
This commit is contained in:
Joey Hess 2019-05-06 16:26:03 -04:00
parent b03e65d260
commit d08c19defb
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38

View file

@ -146,7 +146,7 @@ delete oldvalue ref = run
{- Gets the sha of the tree a ref uses. -} {- Gets the sha of the tree a ref uses. -}
tree :: Ref -> Repo -> IO (Maybe Sha) tree :: Ref -> Repo -> IO (Maybe Sha)
tree (Ref ref) = extractSha <$$> pipeReadStrict tree (Ref ref) = extractSha <$$> pipeReadStrict
[ Param "rev-parse", Param ref' ] [ Param "rev-parse", Param "--quiet", Param ref' ]
where where
ref' = if ":" `isInfixOf` ref ref' = if ":" `isInfixOf` ref
then ref then ref