clone_submodule: avoid using `access()` on directories
[git.git] / t / t3426-rebase-submodule.sh
blobba069dccbdf56197b0e93831fdb1316853d54ef4
1 #!/bin/sh
3 test_description='rebase can handle submodules'
5 . ./test-lib.sh
6 . "$TEST_DIRECTORY"/lib-submodule-update.sh
7 . "$TEST_DIRECTORY"/lib-rebase.sh
9 git_rebase () {
10 git status -su >expect &&
11 ls -1pR * >>expect &&
12 git checkout -b ours HEAD &&
13 echo x >>file1 &&
14 git add file1 &&
15 git commit -m add_x &&
16 git revert HEAD &&
17 git status -su >actual &&
18 ls -1pR * >>actual &&
19 test_cmp expect actual &&
20 may_only_be_test_must_fail "$2" &&
21 $2 git rebase "$1"
24 test_submodule_switch_func "git_rebase"
26 git_rebase_interactive () {
27 git status -su >expect &&
28 ls -1pR * >>expect &&
29 git checkout -b ours HEAD &&
30 echo x >>file1 &&
31 git add file1 &&
32 git commit -m add_x &&
33 git revert HEAD &&
34 git status -su >actual &&
35 ls -1pR * >>actual &&
36 test_cmp expect actual &&
37 set_fake_editor &&
38 mkdir .git/info &&
39 echo "fake-editor.sh" >.git/info/exclude &&
40 may_only_be_test_must_fail "$2" &&
41 $2 git rebase -i "$1"
44 test_submodule_switch_func "git_rebase_interactive"
46 test_expect_success 'rebase interactive ignores modified submodules' '
47 test_when_finished "rm -rf super sub" &&
48 git init sub &&
49 git -C sub commit --allow-empty -m "Initial commit" &&
50 git init super &&
51 git -c protocol.file.allow=always \
52 -C super submodule add ../sub &&
53 git -C super config submodule.sub.ignore dirty &&
54 >super/foo &&
55 git -C super add foo &&
56 git -C super commit -m "Initial commit" &&
57 test_commit -C super a &&
58 test_commit -C super b &&
59 test_commit -C super/sub c &&
60 set_fake_editor &&
61 git -C super rebase -i HEAD^^
64 test_done