remove slightly unsafe use of head

If git rev-parse somehow didn't output anything, git-annex would crash
here.
This commit is contained in:
Joey Hess 2024-09-26 17:21:22 -04:00
parent 99236376e7
commit 5a8add5d55
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38

View file

@ -79,7 +79,7 @@ checkCanUninit recordok =
current_branch =
ifM (inRepo Git.Ref.headExists)
( Just . Git.Ref . encodeBS . Prelude.head . lines . decodeBS <$> revhead
( headMaybe . map (Git.Ref . encodeBS) . lines . decodeBS <$> revhead
, return Nothing
)
revhead = inRepo $ Git.Command.pipeReadStrict