Re: [PATCH] Fix handle leak in builtin-pack-objects
- From
Johannes Sixt <j.sixt@viscovery.net>
- Date
- Nov 19, 2008, 14:52 UTC
- Message-ID
- <49242821.50604@viscovery.net>
- In-Reply-To
- <alpine.LFD.2.00.0811190940480.27509@xanadu.home>
Nicolas Pitre schrieb:
Show 15 quoted lines
> On Wed, 19 Nov 2008, Johannes Sixt wrote: >> The unusual case is where you do this: >> >> $ git rev-list -10 HEAD | git pack-objects foobar >> >> twice in a row: In this case the second invocation fails on Windows >> because the destination pack file already exists *and* is open. But not >> even git-repack does this even if it is called twice. OTOH, the test case >> *does* exactly this. > > OK.... Well, despite my earlier assertion, I think the above should be a > valid operation. > > I'm looking at it now. I'm therefore revoking my earlier ACK as well > (better keep that test case alive).
Hold on a moment: When I tested the above sequence, I was fooled by a flaw in mingw_rename() (it doesn't replace read-only files). With that fixed, it works as expected in repeated invocations (note that foobar is outside the .git/objects/pack directory).
If I use .git/objects/pack/foobar instead, then I get the failures on Windows, and I won't argue that this should be "fixed". ;)
-- Hannes