diff --git a/builtin/bisect.c b/builtin/bisect.c index 9fc8db0694..0786ebf401 100644 --- a/builtin/bisect.c +++ b/builtin/bisect.c @@ -1292,7 +1292,7 @@ static int bisect_run(struct bisect_terms *terms, int argc, const char **argv) puts(_("bisect found first bad commit")); res = BISECT_OK; } else if (res) { - error(_("bisect run failed: 'bisect-state %s'" + error(_("bisect run failed: 'git bisect %s'" " exited with error code %d"), new_state, res); } else { continue; diff --git a/t/t6030-bisect-porcelain.sh b/t/t6030-bisect-porcelain.sh index 9e56b42b5d..0a62ea2b3c 100755 --- a/t/t6030-bisect-porcelain.sh +++ b/t/t6030-bisect-porcelain.sh @@ -1221,4 +1221,14 @@ test_expect_success 'bisect state output with bad commit' ' grep -F "waiting for good commit(s), bad commit known" output ' +test_expect_success 'verify correct error message' ' + git bisect reset && + git bisect start $HASH4 $HASH1 && + write_script test_script.sh <<-\EOF && + rm .git/BISECT* + EOF + test_must_fail git bisect run ./test_script.sh 2>error && + grep "git bisect good.*exited with error code" error +' + test_done