Merge branch 'ew/doc-split-pack-disables-bitmap' into HEAD
[git] / t / t5572-pull-submodule.sh
1 #!/bin/sh
2
3 test_description='pull can handle submodules'
4
5 . ./test-lib.sh
6 . "$TEST_DIRECTORY"/lib-submodule-update.sh
7
8 reset_branch_to_HEAD () {
9         git branch -D "$1" &&
10         git checkout -b "$1" HEAD &&
11         git branch --set-upstream-to="origin/$1" "$1"
12 }
13
14 git_pull () {
15         reset_branch_to_HEAD "$1" &&
16         git pull
17 }
18
19 # pulls without conflicts
20 test_submodule_switch "git_pull"
21
22 git_pull_ff () {
23         reset_branch_to_HEAD "$1" &&
24         git pull --ff
25 }
26
27 test_submodule_switch "git_pull_ff"
28
29 git_pull_ff_only () {
30         reset_branch_to_HEAD "$1" &&
31         git pull --ff-only
32 }
33
34 test_submodule_switch "git_pull_ff_only"
35
36 git_pull_noff () {
37         reset_branch_to_HEAD "$1" &&
38         git pull --no-ff
39 }
40
41 KNOWN_FAILURE_NOFF_MERGE_DOESNT_CREATE_EMPTY_SUBMODULE_DIR=1
42 KNOWN_FAILURE_NOFF_MERGE_ATTEMPTS_TO_MERGE_REMOVED_SUBMODULE_FILES=1
43 test_submodule_switch "git_pull_noff"
44
45 test_done