bisect: combine args passed to find_bisection()

Now that find_bisection() accepts multiple boolean arguments, these may
be combined into a single unsigned integer in order to declutter some of
the code in bisect.c

Also, rename the existing "flags" bitfield to "commit_flags", to
explicitly differentiate it from the new "bisect_flags" bitfield.

Based-on-patch-by: Harald Nordgren <haraldnordgren@gmail.com>
Signed-off-by: Aaron Lipman <alipman88@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Aaron Lipman
2020-08-07 17:58:38 -04:00
committed by Junio C Hamano
parent e8861ffc20
commit ad464a4e84
3 changed files with 49 additions and 32 deletions

View File

@ -637,8 +637,15 @@ int cmd_rev_list(int argc, const char **argv, const char *prefix)
if (bisect_list) {
int reaches, all;
unsigned bisect_flags = 0;
find_bisection(&revs.commits, &reaches, &all, bisect_find_all, revs.first_parent_only);
if (bisect_find_all)
bisect_flags |= FIND_BISECTION_ALL;
if (revs.first_parent_only)
bisect_flags |= FIND_BISECTION_FIRST_PARENT_ONLY;
find_bisection(&revs.commits, &reaches, &all, bisect_flags);
if (bisect_show_vars)
return show_bisect_vars(&info, reaches, all);