1
1
mirror of https://github.com/nmattia/niv.git synced 2024-11-29 09:42:35 +03:00

Show stdout on parse failure of ref and HEAD

This commit is contained in:
Nicolas Mattia 2019-12-01 12:45:37 +01:00
parent c51947d4bf
commit c012e4b424

View File

@ -151,7 +151,9 @@ defaultRefAndHEAD repo = do
sout <- runGit args
case sout of
(l1:l2:_) -> (,) <$> parseRef l1 <*> parseRev l2
_ -> abortGitFailure args "Could not read reference and revision."
_ -> abortGitFailure args $ T.unlines $
[ "Could not read reference and revision from stdout:"
] <> sout
where
args = [ "ls-remote", "--symref", repo, "HEAD" ]
parseRef l = maybe (abortNoRef args l) pure $ do