Re: gc considered dangerous
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Feb 8, 2009, 20:00 UTC
- Message-ID
- <7vhc34y9za.fsf@gitster.siamese.dyndns.org>
- In-Reply-To
- <alpine.DEB.1.00.0902081551290.10279@pacific.mpi-cbg.de>
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
Show 9 quoted lines
> My preliminary guess is that this code in pack-write.c needs to use the
> lock file paradigm:
>
> if (!index_name) {
> [...]
> } else {
> unlink(index_name);
> fd = open(index_name, O_CREAT|O_EXCL|O_WRONLY, 0600);
> }Whoa. That particular code has been (and is still) correct.
When repacking we should pack into a temporary pack and idx file and then replace the real ones after both new pack and its idx are successfully written, and I thought that is how we've been doing this all the time. Maybe the caller has been broken at some point? Sigh...