From: Patrick Steinhardt Date: Wed, 07 Feb 2024 07:42:38 GMT Subject: Re: [PATCH 4/4] Always check `parse_tree*()`'s return value Message-ID: In-Reply-To: <93abd7000b81bbcd7f5422715b4bbb60c69a7cde.1707212981.git.gitgitgadget@gmail.com> On Tue, Feb 06, 2024 at 09:49:41AM +0000, Johannes Schindelin via GitGitGadget wrote: > From: Johannes Schindelin [snip] > diff --git a/cache-tree.c b/cache-tree.c > index 641427ed410..c6508b64a5c 100644 > --- a/cache-tree.c > +++ b/cache-tree.c > @@ -779,8 +779,8 @@ static void prime_cache_tree_rec(struct repository *r, > struct cache_tree_sub *sub; > struct tree *subtree = lookup_tree(r, &entry.oid); > > - if (!subtree->object.parsed) > - parse_tree(subtree); > + if (!subtree->object.parsed && parse_tree(subtree) < 0) > + exit(128); It's somewhat weird that we have the `subtree->object.parsed` check in the first place, because the first thing that `parse_tree_gently()` does is to check that flag and immediately return when the tree is parsed already. It's a preexisting issue though, so this is fine. Patrick