Re: [PATCH] Fix handle leak in builtin-pack-objects
- From
Johannes Sixt <j.sixt@viscovery.net>
- Date
- Nov 19, 2008, 13:55 UTC
- Message-ID
- <49241AEF.1080808@viscovery.net>
- In-Reply-To
- <81b0412b0811190534r4f71f981s53de415f79e56e25@mail.gmail.com>
Alex Riesen schrieb:
Show 10 quoted lines
> 2008/11/19 Nicolas Pitre <nico@cam.org>: >> On Wed, 19 Nov 2008, Johannes Sixt wrote: >>> The work-around is to write the repacked objects to a file of a different >>> name, and replace the original after git-pack-objects has terminated. >>> >>> Signed-off-by: Johannes Sixt <j6t@kdbg.org> >> Acked-by: Nicolas Pitre <nico@cam.org> > > Are you sure? Will it work in a real repository? Were noone does > rename the previous pack files into packtmp-something?
Oh, the patch only works around the failure in the test case. In a real repository there is usually no problem because the destination pack file does not exist.
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.
-- Hannes