]>
Commit | Line | Data |
---|---|---|
283f56a4 JL |
1 | #!/bin/sh |
2 | ||
3 | test_description='cherry-pick can handle submodules' | |
4 | ||
cbc75a12 | 5 | GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main |
334afbc7 JS |
6 | export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME |
7 | ||
283f56a4 JL |
8 | . ./test-lib.sh |
9 | . "$TEST_DIRECTORY"/lib-submodule-update.sh | |
10 | ||
aa2faac0 EN |
11 | if test "$GIT_TEST_MERGE_ALGORITHM" != ort |
12 | then | |
13 | KNOWN_FAILURE_NOFF_MERGE_DOESNT_CREATE_EMPTY_SUBMODULE_DIR=1 | |
14 | KNOWN_FAILURE_NOFF_MERGE_ATTEMPTS_TO_MERGE_REMOVED_SUBMODULE_FILES=1 | |
15 | fi | |
aa06180a | 16 | test_submodule_switch "cherry-pick" |
283f56a4 | 17 | |
c641ca67 | 18 | test_expect_success 'unrelated submodule/file conflict is ignored' ' |
f8d510ed TB |
19 | test_config_global protocol.file.allow always && |
20 | ||
89c4ee4e SB |
21 | test_create_repo sub && |
22 | ||
23 | touch sub/file && | |
24 | git -C sub add file && | |
25 | git -C sub commit -m "add a file in a submodule" && | |
26 | ||
27 | test_create_repo a_repo && | |
28 | ( | |
29 | cd a_repo && | |
30 | >a_file && | |
31 | git add a_file && | |
32 | git commit -m "add a file" && | |
33 | ||
34 | git branch test && | |
35 | git checkout test && | |
36 | ||
37 | mkdir sub && | |
38 | >sub/content && | |
39 | git add sub/content && | |
40 | git commit -m "add a regular folder with name sub" && | |
41 | ||
42 | echo "123" >a_file && | |
43 | git add a_file && | |
44 | git commit -m "modify a file" && | |
45 | ||
cbc75a12 | 46 | git checkout main && |
89c4ee4e SB |
47 | |
48 | git submodule add ../sub sub && | |
49 | git submodule update sub && | |
50 | git commit -m "add a submodule info folder with name sub" && | |
51 | ||
52 | git cherry-pick test | |
53 | ) | |
54 | ' | |
55 | ||
283f56a4 | 56 | test_done |