1#!/bin/sh
2
3test_description='pull can handle submodules'
4
5. ./test-lib.sh
6. "$TEST_DIRECTORY"/lib-submodule-update.sh
7
8reset_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
14git_pull () {
15 reset_branch_to_HEAD "$1" &&
16 git pull
17}
18
19# pulls without conflicts
20test_submodule_switch "git_pull"
21
22git_pull_ff () {
23 reset_branch_to_HEAD "$1" &&
24 git pull --ff
25}
26
27test_submodule_switch "git_pull_ff"
28
29git_pull_ff_only () {
30 reset_branch_to_HEAD "$1" &&
31 git pull --ff-only
32}
33
34test_submodule_switch "git_pull_ff_only"
35
36git_pull_noff () {
37 reset_branch_to_HEAD "$1" &&
38 git pull --no-ff
39}
40
41KNOWN_FAILURE_NOFF_MERGE_DOESNT_CREATE_EMPTY_SUBMODULE_DIR=1
42KNOWN_FAILURE_NOFF_MERGE_ATTEMPTS_TO_MERGE_REMOVED_SUBMODULE_FILES=1
43test_submodule_switch "git_pull_noff"
44
45test_done