mirror of
https://github.com/git/git.git
synced 2024-10-31 22:37:54 +01:00
Merge branch 'cc/bisect-rev-parsing'
The logic in "git bisect bad HEAD" etc. to avoid forcing the test of the common ancestor of bad and good commits was broken. * cc/bisect-rev-parsing: bisect: add test to check that revs are properly parsed bisect: parse revs before passing them to check_expected_revs()
This commit is contained in:
commit
42618bc34e
2 changed files with 16 additions and 4 deletions
|
@ -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.")" ;;
|
||||
*)
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue