blob: 62b8a2e7bbd1cf26710be0a0eb90041d5e3f7d2c [file] [log] [blame]
Jens Lehmann8f8ba562014-06-19 22:12:48 +02001#!/bin/sh
2
3test_description='bisect can handle submodules'
4
5. ./test-lib.sh
6. "$TEST_DIRECTORY"/lib-submodule-update.sh
7
8git_bisect () {
9 git status -su >expect &&
10 ls -1pR * >>expect &&
Stefan Bellerf5ee54a2016-05-09 10:09:08 -070011 tar cf "$TRASH_DIRECTORY/tmp.tar" * &&
Jens Lehmann8f8ba562014-06-19 22:12:48 +020012 GOOD=$(git rev-parse --verify HEAD) &&
13 git checkout "$1" &&
14 echo "foo" >bar &&
15 git add bar &&
16 git commit -m "bisect bad" &&
17 BAD=$(git rev-parse --verify HEAD) &&
18 git reset --hard HEAD^^ &&
19 git submodule update &&
20 git bisect start &&
21 git bisect good $GOOD &&
22 rm -rf * &&
Stefan Bellerf5ee54a2016-05-09 10:09:08 -070023 tar xf "$TRASH_DIRECTORY/tmp.tar" &&
Jens Lehmann8f8ba562014-06-19 22:12:48 +020024 git status -su >actual &&
25 ls -1pR * >>actual &&
26 test_cmp expect actual &&
27 git bisect bad $BAD
28}
29
30test_submodule_switch "git_bisect"
31
32test_done