fix overwrite race with small file that got large
When adding a small file, it does not get locked down, so can be modified after git-annex checks that it's small. The use of queued git add made the race window nice and wide too. Fixed by checking if the file has changed, and by not using git add. Instead, have to recapitulate git add's handling of things like symlinks and executable files. Sponsored-by: Jochen Bartl on Patreon
This commit is contained in:
parent
56e095aaf4
commit
f259be7f39
5 changed files with 93 additions and 65 deletions
|
@ -50,8 +50,10 @@ added to the annex after all. Test case for this:
|
|||
git-annex add
|
||||
git diff --cached 1
|
||||
|
||||
Unsure how to fix this case yet? Maybe it needs to cache the inode,
|
||||
Guess it needs to cache the inode,
|
||||
hash the file content, then verifiy the inode did not change during
|
||||
hashing, and then also use update-index.
|
||||
|
||||
> [[done]]
|
||||
|
||||
--[[Joey]]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue