Merge branch 'tb/commit-graph-genv2-upgrade-fix' into maint
[git/debian.git] / t / t3512-cherry-pick-submodule.sh
blobc657840db33b6e8d4c47ece5c9eb0feba495825a
1 #!/bin/sh
3 test_description='cherry-pick can handle submodules'
5 GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
6 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
8 . ./test-lib.sh
9 . "$TEST_DIRECTORY"/lib-submodule-update.sh
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
16 test_submodule_switch "cherry-pick"
18 test_expect_success 'unrelated submodule/file conflict is ignored' '
19 test_create_repo sub &&
21 touch sub/file &&
22 git -C sub add file &&
23 git -C sub commit -m "add a file in a submodule" &&
25 test_create_repo a_repo &&
27 cd a_repo &&
28 >a_file &&
29 git add a_file &&
30 git commit -m "add a file" &&
32 git branch test &&
33 git checkout test &&
35 mkdir sub &&
36 >sub/content &&
37 git add sub/content &&
38 git commit -m "add a regular folder with name sub" &&
40 echo "123" >a_file &&
41 git add a_file &&
42 git commit -m "modify a file" &&
44 git checkout main &&
46 git submodule add ../sub sub &&
47 git submodule update sub &&
48 git commit -m "add a submodule info folder with name sub" &&
50 git cherry-pick test
54 test_done