]> git.ipfire.org Git - thirdparty/git.git/commit
bisect: simplify return code from bisect_checkout()
authorJunio C Hamano <gitster@pobox.com>
Wed, 28 Jul 2021 17:07:02 +0000 (10:07 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 28 Jul 2021 17:57:37 +0000 (10:57 -0700)
commit1fcc40cd1dbfbdf6879a7b60a3a0250e46dc5c60
treefa5a5c99d04357d11b207d937711cfcaa46357cc
parentffcb4e94d309db2889dac1d3dcbd0f4b2a0f6390
bisect: simplify return code from bisect_checkout()

The function was designed to return only BISECT_OK (0) or
BISECT_FAILED (-1) and no other values, but there were two issues:

 - The comment misspelled BISECT_FAILED as BISECT_FAILURE, even
   though the logic it described (i.e. any non-zero return should be
   reported as a single BISECT_FAILED) was correct.

 - It took the return value from run_command_v_opt(), and assumed it
   was either -1 or 1 upon error, which is not the case; it can relay
   errors from wait_or_whine(), which can report exit status of the
   child process.

Translate any error return from run_command_v_opt() to BISECT_FAILED,
and simplify the resulting code by losing the 'res' variable that is
no longer needed.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
bisect.c