summaryrefslogtreecommitdiff
path: root/t/t5572-pull-submodule.sh
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2014-07-21 11:18:30 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2014-07-21 11:18:31 -0700
commitad25da009e2a37306d2d53a8462f036ef532b4ff (patch)
treee6d71ce06709b09066f2dc80276e3f8ea0cda8d6 /t/t5572-pull-submodule.sh
parentMerge branch 'ak/profile-feedback-build' (diff)
parentrevert: add t3513 for submodule updates (diff)
downloadtgif-ad25da009e2a37306d2d53a8462f036ef532b4ff.tar.xz
Merge branch 'jl/submodule-tests'
* jl/submodule-tests: revert: add t3513 for submodule updates stash: add t3906 for submodule updates am: add t4255 for submodule updates cherry-pick: add t3512 for submodule updates pull: add t5572 for submodule updates rebase: add t3426 for submodule updates merge: add t7613 for submodule updates bisect: add t6041 for submodule updates reset: add t7112 for submodule updates read-tree: add t1013 for submodule updates apply: add t4137 for submodule updates checkout: call the new submodule update test framework submodules: add the lib-submodule-update.sh test library test-lib: add test_dir_is_empty()
Diffstat (limited to 't/t5572-pull-submodule.sh')
-rwxr-xr-xt/t5572-pull-submodule.sh45
1 files changed, 45 insertions, 0 deletions
diff --git a/t/t5572-pull-submodule.sh b/t/t5572-pull-submodule.sh
new file mode 100755
index 0000000000..accfa5cc0c
--- /dev/null
+++ b/t/t5572-pull-submodule.sh
@@ -0,0 +1,45 @@
+#!/bin/sh
+
+test_description='pull can handle submodules'
+
+. ./test-lib.sh
+. "$TEST_DIRECTORY"/lib-submodule-update.sh
+
+reset_branch_to_HEAD () {
+ git branch -D "$1" &&
+ git checkout -b "$1" HEAD &&
+ git branch --set-upstream-to="origin/$1" "$1"
+}
+
+git_pull () {
+ reset_branch_to_HEAD "$1" &&
+ git pull
+}
+
+# pulls without conflicts
+test_submodule_switch "git_pull"
+
+git_pull_ff () {
+ reset_branch_to_HEAD "$1" &&
+ git pull --ff
+}
+
+test_submodule_switch "git_pull_ff"
+
+git_pull_ff_only () {
+ reset_branch_to_HEAD "$1" &&
+ git pull --ff-only
+}
+
+test_submodule_switch "git_pull_ff_only"
+
+git_pull_noff () {
+ reset_branch_to_HEAD "$1" &&
+ git pull --no-ff
+}
+
+KNOWN_FAILURE_NOFF_MERGE_DOESNT_CREATE_EMPTY_SUBMODULE_DIR=1
+KNOWN_FAILURE_NOFF_MERGE_ATTEMPTS_TO_MERGE_REMOVED_SUBMODULE_FILES=1
+test_submodule_switch "git_pull_noff"
+
+test_done