]> git.ipfire.org Git - thirdparty/git.git/blame - t/t6041-bisect-submodule.sh
Merge branch 'dl/test-must-fail-fixes-5'
[thirdparty/git.git] / t / t6041-bisect-submodule.sh
CommitLineData
8f8ba56b
JL
1#!/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 &&
f5ee54aa 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 * &&
f5ee54aa 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 35test_submodule_switch_func "git_bisect"
8f8ba56b
JL
36
37test_done