work around git segfault
Work around bug in git 2.37 that causes a segfault when when core.untrackedCache is set, and broke git-annex init. Depending on when git gets fixed and how widely the buggy versions are used, this could be reverted quite soon, or need to linger for a long time. It only makes git-annex init a tiny bit slower in a new repo. Sponsored-by: Max Thoursie on Patreon
This commit is contained in:
parent
008204b2f3
commit
a23fd7349f
3 changed files with 23 additions and 0 deletions
|
@ -133,6 +133,11 @@ getBranch = maybe (hasOrigin >>= go >>= use) return =<< branchsha
|
|||
fromMaybe (error $ "failed to create " ++ fromRef name)
|
||||
<$> branchsha
|
||||
go False = withIndex' True $ do
|
||||
-- Create the index file. This is not necessary,
|
||||
-- except to avoid a bug in git that causes
|
||||
-- git write-tree to segfault when the index file does not
|
||||
-- exist.
|
||||
inRepo $ flip Git.UpdateIndex.streamUpdateIndex []
|
||||
cmode <- annexCommitMode <$> Annex.getGitConfig
|
||||
cmessage <- createMessage
|
||||
inRepo $ Git.Branch.commitAlways cmode cmessage fullname []
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue