Improve robustness of direct mode merge, avoiding a crash if the index file is missing.

I couldn't find a good way to make an *empty* index file (zero byte file
won't do), so I punted and just don't make index.lock when there's no index
yet. This means some other git process could race and write an index file
at the same time as the merge is ongoing, in theory. Only happens in new
repos though.
This commit is contained in:
Joey Hess 2015-09-22 12:59:56 -04:00
parent 84f07eb947
commit dc2f1f09b7
4 changed files with 29 additions and 3 deletions

3
debian/changelog vendored
View file

@ -10,6 +10,9 @@ git-annex (5.20150917) UNRELEASED; urgency=medium
to use Google's NearLine storage.
* Improve ~/.ssh/config modification code to not add trailing spaces
to lines it cannot parse.
* Fix a crash at direct mode merge time when .git/index doesn't exist
yet. Triggered by eg, git-annex sync --no-commit in a fresh clone of
a repository.
-- Joey Hess <id@joeyh.name> Wed, 16 Sep 2015 12:23:33 -0400