164
164
cp .git/BISECT_START saved &&
165
165
test_must_fail git bisect start $HASH4 foo -- &&
166
166
git branch > branch.output &&
167
test_i18ngrep "* (no branch)" branch.output > /dev/null &&
167
test_i18ngrep "* (no branch, bisect started on other)" branch.output > /dev/null &&
168
168
test_cmp saved .git/BISECT_START
170
170
test_expect_success 'bisect start: no ".git/BISECT_START" if mistaken rev' '
190
190
# $HASH1 is good, $HASH4 is bad, we skip $HASH3
191
191
# but $HASH2 is bad,
192
192
# so we should find $HASH2 as the first bad commit
193
test_expect_success 'bisect skip: successfull result' '
193
test_expect_success 'bisect skip: successful result' '
194
194
git bisect reset &&
195
195
git bisect start $HASH4 $HASH1 &&
196
196
git bisect skip &&
678
678
echo "Checking $1 is the same as $2" &&
679
git rev-parse "$1" > expected.same &&
680
git rev-parse "$2" > expected.actual &&
681
test_cmp expected.same expected.actual
679
test_cmp_rev "$1" "$2"
684
682
test_expect_success 'bisect: --no-checkout - start commit bad' '
744
cat > expected.bisect-log <<EOF
745
# bad: [32a594a3fdac2d57cf6d02987e30eec68511498c] Add <4: Ciao for now> into <hello>.
746
# good: [7b7f204a749c3125d5224ed61ea2ae1187ad046f] Add <2: A new day for git> into <hello>.
747
git bisect start '32a594a3fdac2d57cf6d02987e30eec68511498c' '7b7f204a749c3125d5224ed61ea2ae1187ad046f'
748
# good: [3de952f2416b6084f557ec417709eac740c6818c] Add <3: Another new day for git> into <hello>.
749
git bisect good 3de952f2416b6084f557ec417709eac740c6818c
750
# first bad commit: [32a594a3fdac2d57cf6d02987e30eec68511498c] Add <4: Ciao for now> into <hello>.
753
test_expect_success 'bisect log: successfull result' '
755
git bisect start $HASH4 $HASH2 &&
757
git bisect log >bisect-log.txt &&
758
test_cmp expected.bisect-log bisect-log.txt &&
762
cat > expected.bisect-skip-log <<EOF
763
# bad: [32a594a3fdac2d57cf6d02987e30eec68511498c] Add <4: Ciao for now> into <hello>.
764
# good: [7b7f204a749c3125d5224ed61ea2ae1187ad046f] Add <2: A new day for git> into <hello>.
765
git bisect start '32a594a3fdac2d57cf6d02987e30eec68511498c' '7b7f204a749c3125d5224ed61ea2ae1187ad046f'
766
# skip: [3de952f2416b6084f557ec417709eac740c6818c] Add <3: Another new day for git> into <hello>.
767
git bisect skip 3de952f2416b6084f557ec417709eac740c6818c
768
# only skipped commits left to test
769
# possible first bad commit: [32a594a3fdac2d57cf6d02987e30eec68511498c] Add <4: Ciao for now> into <hello>.
770
# possible first bad commit: [3de952f2416b6084f557ec417709eac740c6818c] Add <3: Another new day for git> into <hello>.
773
test_expect_success 'bisect log: only skip commits left' '
775
git bisect start $HASH4 $HASH2 &&
776
test_must_fail git bisect skip &&
777
git bisect log >bisect-skip-log.txt &&
778
test_cmp expected.bisect-skip-log bisect-skip-log.txt &&