]>
Commit | Line | Data |
---|---|---|
8f8ba56b JL |
1 | #!/bin/sh |
2 | ||
3 | test_description='bisect can handle submodules' | |
4 | ||
5 | . ./test-lib.sh | |
6 | . "$TEST_DIRECTORY"/lib-submodule-update.sh | |
7 | ||
8 | git_bisect () { | |
9 | git status -su >expect && | |
10 | ls -1pR * >>expect && | |
5317dfea | 11 | "$TAR" cf "$TRASH_DIRECTORY/tmp.tar" * && |
8f8ba56b | 12 | GOOD=$(git rev-parse --verify HEAD) && |
5b0ac09f DL |
13 | may_only_be_test_must_fail "$2" && |
14 | $2 git checkout "$1" && | |
15 | if test -n "$2" | |
16 | then | |
17 | return | |
18 | fi && | |
8f8ba56b JL |
19 | echo "foo" >bar && |
20 | git add bar && | |
21 | git commit -m "bisect bad" && | |
22 | BAD=$(git rev-parse --verify HEAD) && | |
23 | git reset --hard HEAD^^ && | |
24 | git submodule update && | |
25 | git bisect start && | |
26 | git bisect good $GOOD && | |
27 | rm -rf * && | |
5317dfea | 28 | "$TAR" xf "$TRASH_DIRECTORY/tmp.tar" && |
8f8ba56b JL |
29 | git status -su >actual && |
30 | ls -1pR * >>actual && | |
31 | test_cmp expect actual && | |
32 | git bisect bad $BAD | |
33 | } | |
34 | ||
aa06180a | 35 | test_submodule_switch_func "git_bisect" |
8f8ba56b JL |
36 | |
37 | test_done |