Re: 2.2.0-rc behavior changes (2/2)
- From
Jeff King <peff@peff.net>
- Date
- Nov 10, 2014, 09:31 UTC
- Message-ID
- <20141110093128.GB11387@peff.net>
- In-Reply-To
- <CAGyf7-GWBWrV9SjMY3n3B-0gCMZGfEsYfX-0vSvz6GT6r=vO6A@mail.gmail.com>
On Mon, Nov 10, 2014 at 07:51:00PM +1100, Bryan Turner wrote:
Show 6 quoted lines
> Second change: git gc --auto now fails if there are loose empty blobs. > > We have a test which just touched empty files in objects/17 to trigger > the gc --auto preconditions (Note: I realize this is completely > invalid, and I've changed the test to no longer do this; I'm only > surfacing the behavioral change).
This is expected. As you noticed here:
> error: object file > .git/objects/17/02d54e8fba95ef9968a0c9b183fe22ec551c86 is empty > fatal: unable to get object info for 1702d54e8fba95ef9968a0c9b183fe22ec551c86 > error: failed to run prune
the error comes from "git prune" failing. It is using unreachable but "recent" objects as graph tips to keep around. If we can't load a tip object, we abort the prune, because we would not want to delete objects that might have been referenced (e.g., if it were a real corrupted object that we could not read).
The second behavior (die on broken objects) has been around for a while. The new change (in the commit you bisected to) is that we are considering more objects.
I'll admit I didn't really consider the impact on sticking broken object files into the object directory, but I think the code is doing the sensible and safe thing.
-Peff