Jeff King <peff@xxxxxxxx> writes: > On Fri, Sep 06, 2019 at 09:59:04AM -0700, Junio C Hamano wrote: > >> Jeff King <peff@xxxxxxxx> writes: >> >> > So far so good. But now imagine we call parse_commit_buffer() again, and >> > we re-parse. How does that interact with the half-parsed state? Some of >> > it works OK (e.g., lookup_tree() would find the same tree). Some not so >> > much (I think we'd keep appending parents at each call). >> > >> > I guess this might not be too bad to handle. Value fields like >> > timestamp_t are OK to overwrite. Pointers to objects likewise, since the >> > memory is owned elsewhere. If we see existing parent pointers in an >> > object we're parsing, we could probably free them under the assumption >> > they're leftover cruft. Likewise for the "tag" field of "struct tag", >> > which is owned by the struct and should be freed. >> >> Yeah, or clear them before returning with .corrupt bit set? > > This was my attempt to avoid dealing with a .corrupt bit. :) Then, clear them before returning with .parsed bit clear?