3 test_description
='rebase can handle submodules'
5 TEST_PASSES_SANITIZE_LEAK
=true
7 .
"$TEST_DIRECTORY"/lib-submodule-update.sh
8 .
"$TEST_DIRECTORY"/lib-rebase.sh
11 git status
-su >expect
&&
13 git checkout
-b ours HEAD
&&
16 git commit
-m add_x
&&
18 git status
-su >actual
&&
20 test_cmp expect actual
&&
21 may_only_be_test_must_fail
"$2" &&
25 test_submodule_switch_func
"git_rebase"
27 git_rebase_interactive
() {
28 git status
-su >expect
&&
30 git checkout
-b ours HEAD
&&
33 git commit
-m add_x
&&
35 git status
-su >actual
&&
37 test_cmp expect actual
&&
40 echo "fake-editor.sh" >.git
/info
/exclude
&&
41 may_only_be_test_must_fail
"$2" &&
45 test_submodule_switch_func
"git_rebase_interactive"
47 test_expect_success
'rebase interactive ignores modified submodules' '
48 test_when_finished "rm -rf super sub" &&
50 git -C sub commit --allow-empty -m "Initial commit" &&
52 git -c protocol.file.allow=always \
53 -C super submodule add ../sub &&
54 git -C super config submodule.sub.ignore dirty &&
56 git -C super add foo &&
57 git -C super commit -m "Initial commit" &&
58 test_commit -C super a &&
59 test_commit -C super b &&
60 test_commit -C super/sub c &&
62 git -C super rebase -i HEAD^^