From: Ævar Arnfjörð Bjarmason Date: Sat, 11 Sep 2021 10:07:57 GMT Subject: Re: [PATCH 1/8] midx: expose 'write_midx_file_only()' publicly Message-ID: <87a6kja0b2.fsf@evledraar.gmail.com> In-Reply-To: <4afa03b972a1885c60fbf3716f22a7ab58056383.1631331139.git.me@ttaylorr.com> On Fri, Sep 10 2021, Taylor Blau wrote: > - if (ctx->m && midx_contains_pack(ctx->m, file_name)) > - return; > + if (ctx->m) { > + if (midx_contains_pack(ctx->m, file_name)) > + return; > + } else if (ctx->to_include) { > + if (!string_list_has_string(ctx->to_include, file_name)) > + return; > + } I think this is equivalent to: if (ctx->m && midx_contains_pack(ctx->m, file_name)) return; else if (!ctx->m && string_list_has_string(...)) return; Just a suggestion/tip to reduce the diff size/nested if/if blocks. > +int write_midx_file_only(const char *object_dir, struct string_list *packs_to_include, const char *preferred_pack_name, unsigned flags); Let's also line-wrap header changes like in the *.c file.