diff options
author | Ramsay Jones <ramsay@ramsayjones.plus.com> | 2021-04-29 21:15:15 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-04-30 09:56:42 +0900 |
commit | 4cd66e7d6b423d3c5b161b55afb07cb1df59e75f (patch) | |
tree | 6422c8dac3e99dce2677cd080e293cdd5341acfa /builtin | |
parent | The twelfth batch (diff) | |
download | tgif-4cd66e7d6b423d3c5b161b55afb07cb1df59e75f.tar.xz |
bisect--helper: use BISECT_TERMS in 'bisect skip' command
Commit e4c7b33747 ("bisect--helper: reimplement `bisect_skip` shell
function in C", 2021-02-03), as part of the shell-to-C conversion,
forgot to read the 'terms' file (.git/BISECT_TERMS) during the new
'bisect skip' command implementation. As a result, the 'bisect skip'
command will use the default 'bad'/'good' terms. If the bisection
terms have been set to non-default values (for example by the
'bisect start' command), then the 'bisect skip' command will fail.
In order to correct this problem, we insert a call to the get_terms()
function, which reads the non-default terms from that file (if set),
in the '--bisect-skip' command implementation of 'bisect--helper'.
Also, add a test[1] to protect against potential future regression.
[1] https://lore.kernel.org/git/xmqqim45h585.fsf@gitster.g/T/#m207791568054b0f8cf1a3942878ea36293273c7d
Reported-by: Trygve Aaberge <trygveaa@gmail.com>
Signed-off-by: Bagas Sanjaya <bagasdotme@gmail.com>
Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/bisect--helper.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/builtin/bisect--helper.c b/builtin/bisect--helper.c index 1fdb7d9d10..9d9540a0ab 100644 --- a/builtin/bisect--helper.c +++ b/builtin/bisect--helper.c @@ -1126,6 +1126,7 @@ int cmd_bisect__helper(int argc, const char **argv, const char *prefix) break; case BISECT_SKIP: set_terms(&terms, "bad", "good"); + get_terms(&terms); res = bisect_skip(&terms, argv, argc); break; default: |