Sync with 'maint'
[alt-git.git] / t / t3512-cherry-pick-submodule.sh
blob9387a22a9e7100335208713fcb069b31c69f7e80
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_PASSES_SANITIZE_LEAK=true
9 . ./test-lib.sh
10 . "$TEST_DIRECTORY"/lib-submodule-update.sh
12 if test "$GIT_TEST_MERGE_ALGORITHM" != ort
13 then
14 KNOWN_FAILURE_NOFF_MERGE_DOESNT_CREATE_EMPTY_SUBMODULE_DIR=1
15 KNOWN_FAILURE_NOFF_MERGE_ATTEMPTS_TO_MERGE_REMOVED_SUBMODULE_FILES=1
17 test_submodule_switch "cherry-pick"
19 test_expect_success 'unrelated submodule/file conflict is ignored' '
20 test_config_global protocol.file.allow always &&
22 test_create_repo sub &&
24 touch sub/file &&
25 git -C sub add file &&
26 git -C sub commit -m "add a file in a submodule" &&
28 test_create_repo a_repo &&
30 cd a_repo &&
31 >a_file &&
32 git add a_file &&
33 git commit -m "add a file" &&
35 git branch test &&
36 git checkout test &&
38 mkdir sub &&
39 >sub/content &&
40 git add sub/content &&
41 git commit -m "add a regular folder with name sub" &&
43 echo "123" >a_file &&
44 git add a_file &&
45 git commit -m "modify a file" &&
47 git checkout main &&
49 git submodule add ../sub sub &&
50 git submodule update sub &&
51 git commit -m "add a submodule info folder with name sub" &&
53 git cherry-pick test
57 test_done