From: Patrick Steinhardt Date: Fri, 27 Dec 2024 14:18:22 GMT Subject: Re: [PATCH v4 1/7] path-walk: introduce an object walk by path Message-ID: In-Reply-To: <62f7aae477bc542dce0bb6f8b59438442a77d154.1734711676.git.gitgitgadget@gmail.com> On Fri, Dec 20, 2024 at 04:21:09PM +0000, Derrick Stolee via GitGitGadget wrote: [snip] > +static int add_tree_entries(struct path_walk_context *ctx, > + const char *base_path, > + struct object_id *oid) > +{ > + struct tree_desc desc; > + struct name_entry entry; > + struct strbuf path = STRBUF_INIT; > + size_t base_len; > + struct tree *tree = lookup_tree(ctx->repo, oid); > + > + if (!tree) { > + error(_("failed to walk children of tree %s: not found"), > + oid_to_hex(oid)); > + return -1; > + } else if (parse_tree_gently(tree, 1)) { > + error("bad tree object %s", oid_to_hex(oid)); > + return -1; > + } You can `return error(_("..."));` directly as it already returns `-1`. Not sure whether this by itself warrants a reroll -- probably not. I'll leave it up to you. The rest of the patch series looks as expected, mostly based on the range diff. Patrick