diff options
-rwxr-xr-x | git-bisect.sh | 11 | ||||
-rwxr-xr-x | t/t6030-bisect-porcelain.sh | 9 |
2 files changed, 16 insertions, 4 deletions
diff --git a/git-bisect.sh b/git-bisect.sh index 6cda2b5a60..2fc07acb0f 100755 --- a/git-bisect.sh +++ b/git-bisect.sh @@ -237,15 +237,18 @@ bisect_state() { check_expected_revs "$rev" ;; 2,bad|*,good|*,skip) shift - eval='' + hash_list='' for rev in "$@" do sha=$(git rev-parse --verify "$rev^{commit}") || die "$(eval_gettext "Bad rev input: \$rev")" - eval="$eval bisect_write '$state' '$sha'; " + hash_list="$hash_list $sha" done - eval "$eval" - check_expected_revs "$@" ;; + for rev in $hash_list + do + bisect_write "$state" "$rev" + done + check_expected_revs $hash_list ;; *,bad) die "$(gettext "'git bisect bad' can take only one argument.")" ;; *) diff --git a/t/t6030-bisect-porcelain.sh b/t/t6030-bisect-porcelain.sh index 064f5cefeb..e6abe65d5c 100755 --- a/t/t6030-bisect-porcelain.sh +++ b/t/t6030-bisect-porcelain.sh @@ -779,4 +779,13 @@ test_expect_success 'bisect log: only skip commits left' ' git bisect reset ' +test_expect_success '"git bisect bad HEAD" behaves as "git bisect bad"' ' + git checkout parallel && + git bisect start HEAD $HASH1 && + git bisect good HEAD && + git bisect bad HEAD && + test "$HASH6" = $(git rev-parse --verify HEAD) && + git bisect reset +' + test_done |