Re: [PATCH v3 2/9] midx.c: make changing the preferred pack safe
- From
Taylor Blau <me@ttaylorr.com>
- Date
- Jan 20, 2022, 22:13 UTC
- Message-ID
- <Yenee7bmEEiR2gkj@nand.local>
- In-Reply-To
- <20220120180843.3103044-1-jonathantanmy@google.com>
On Thu, Jan 20, 2022 at 10:08:43AM -0800, Jonathan Tan wrote:
Show 7 quoted lines
> I think the main issue is the first confounding factor you listed above: > even if we didn't have the other confounding factor, that issue alone is > enough to motivate the entire patch set. Likewise, as Junio said [1], I > don't think we need to switch to rename() if we make the checksum > different, so the fix is one-fold, not two-fold. For what it's worth, I > switched back to finalize_object_file() and ran the tests, and they all > pass.
Yeah, I agree with both of you and would rather use finalize_object_file() here and be consistent with other callers that modify $GIT_DIR/objects.
It is safe to do, since the .rev file's name will necessarily be different if the MIDX's object order changes.
> [1] https://lore.kernel.org/git/xmqqtue54iop.fsf@gitster.g/
Thanks, Taylor