From: Junio C Hamano Date: Tue, 27 May 2014 16:55:02 GMT Subject: Re: [PATCH 1/2] remote: defer repacking packed-refs when deleting refs Message-ID: In-Reply-To: Jens Lindström writes: >> Puzzled.... > > There is one reason why one would want to call delete_ref() even if > the ref itself was already fully deleted by repack_without_refs() > (because it was only packed) and that is that delete_ref() also > removes the ref log, if there is one. Ahh, ok, no longer puzzled---I completely forgot about that part. > We could refactor the deletion to > > 1) repack_without_refs() on all refs > 2) delete_ref() on still existing (loose) refs > 3) delete_ref_log() on all refs > > to let us only call delete_ref() on existing refs, and then keep the > current value check. I tend to agree that it is sufficient for the purpose of this topic to be loose about the check; the refactoring can come later, as part of the ref-transaction refactoring that is going on in a separate thread.