Re: [PATCH 1/4] t/helper/test-bitmap.c: add 'dump-hashes' mode
- From
Taylor Blau <me@ttaylorr.com>
- Date
- Sep 8, 2021, 02:24 UTC
- Message-ID
- <YTge2NlvvRC+VoPY@nand.local>
- In-Reply-To
- <878s07kfsg.fsf@evledraar.gmail.com>
On Wed, Sep 08, 2021 at 03:37:05AM +0200, Ævar Arnfjörð Bjarmason wrote:
Show 12 quoted lines
> > +static int bitmap_dump_hashes(void)
> > +{
> > + return test_bitmap_hashes(the_repository);
> > +}
> > [...]
> > return bitmap_list_commits();
> > + if (!strcmp(argv[1], "dump-hashes"))
> > + return bitmap_dump_hashes();
>
> Perhaps the return code only for the brevity of this test-only code?
> Seems like having bitmap_dump_hashes() do the "return 0" would be better
> in that case.Yeah, it is silly to just return a constant from bitmap_dump_hashes (and ditto for bitmap_list_commits), but it makes this easier to write.
I don't care either way. If you feel strongly, then please say so (but I can't imagine that you do).
Thanks, Taylor