git repack -ad can damage a repository that’s partially unreadable by the current user
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
git (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
I'm using Ubuntu 14.10 dev with git 1:2.0.1-1 and if git-gc hasn't full write-access to a repository it can damage it. Getting such a permission state for a git repository isn't even unlikely if it was optimized in a sudo environment before. Here is an example output:
sworddragon@
Counting objects: 1250, done.
Delta compression using up to 6 threads.
Compressing objects: 100% (1220/1220), done.
Writing objects: 100% (1250/1250), done.
Total 1250 (delta 944), reused 295 (delta 0)
sworddragon@
fatal: internal error: packed-ref cache cleared while locked
error: failed to run pack-refs
Changed in git (Ubuntu): | |
status: | Incomplete → New |
I cannot reproduce. The pack files generated by ‘sudo git gc’ are owned by root, but Git never writes to pack files except when initially creating them, so this doesn’t cause any problems.
How do you know that your repository was damaged? Can you give instructions to reproduce the problem from scratch?