Re: [PATCH] bundle-uri: refresh packed_git if unbundle succeed
- From
Junio C Hamano <gitster@pobox.com>
- Date
- May 17, 2024, 16:14 UTC
- Message-ID
- <xmqqikzcl8js.fsf@gitster.g>
- In-Reply-To
- <ZkbkgT46mdNEhcf0@tanuki>
Patrick Steinhardt <ps@pks.im> writes:
Show 12 quoted lines
> Now there are two conflicting thoughts here: > > - Either we can now drop `REF_SKIP_OID_VERIFICATION` as the object IDs > should now be accessible. > > - Or we can avoid calling `reprepare_packed_git()` inside the loop and > instead call it once after we have fetched all bundles. > > The second one feels a bit like premature optimization to me. But the > first item does feel like it could help us to catch broken bundles > because we wouldn't end up creating refs for objects that neither we nor > the bundle have.
I like the way your thoughts are structured around here.
I do agree that the latter is a wrong approach---we shouldn't be trusting what came from elsewhere over the network without first checking. We should probably be running the "index-pack --fix-thin" the unbundling process runs with also the "--fsck-objects" option if we are not doing so already, and even then, we should make sure that the object we are making our ref point at have everything behind it.