Re: [PATCH v5 08/12] bundle: properly clear all revision flags
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Oct 12, 2022, 16:17 UTC
- Message-ID
- <xmqqy1tlkod8.fsf@gitster.g>
- In-Reply-To
- <8dc5a8e4e63dc98642176e5b78be739ef721d2d8.1665579160.git.gitgitgadget@gmail.com>
"Derrick Stolee via GitGitGadget" <gitgitgadget@gmail.com> writes:
Show 18 quoted lines
> From: Derrick Stolee <derrickstolee@github.com> > > The verify_bundle() method checks two things for a bundle's > prerequisites: > > 1. Are these objects in the object store? > 2. Are these objects reachable from our references? > > In this second question, multiple uses of verify_bundle() in the same > process can report an invalid bundle even though it is correct. The > reason is due to not clearing all of the commit marks on the commits > previously walked. > ... > Moving this loop to the cleanup step alone would cause a segfault when > running 'git bundle verify' outside of a repository, but this is because > of that error condition using "goto cleanup" when returning is perfectly > safe. Nothing has been initialized at that point, so we can return > immediately without causing any leaks.
Nicely analyzed. The implementation clearly follows the design described above. Much better than the previous iteration.
Thanks.