projects
/
git-annex.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9923637
)
remove slightly unsafe use of head
author
Joey Hess
<joeyh@joeyh.name>
Thu, 26 Sep 2024 21:21:22 +0000
(17:21 -0400)
committer
Joey Hess
<joeyh@joeyh.name>
Thu, 26 Sep 2024 21:21:22 +0000
(17:21 -0400)
If git rev-parse somehow didn't output anything, git-annex would crash
here.
Command/Uninit.hs
patch
|
blob
|
history
diff --git
a/Command/Uninit.hs
b/Command/Uninit.hs
index 1b2e8395a862152b7b14f25d155287fdeabd9bc1..a38ac9a7e604e95e245a08bc1d53ef3bc089efbd 100644
(file)
--- a/
Command/Uninit.hs
+++ b/
Command/Uninit.hs
@@
-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