summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2009-04-18 21:18:25 (GMT)
committerJunio C Hamano <gitster@pobox.com>2009-04-18 21:18:25 (GMT)
commiteb8a1c4aed2728e1be1c5e39fb9e5a3f4b209fc4 (patch)
treeb20cc784a712eb89f3f1392950472f95ed245966 /t
parent2aa3140bc07d7b593efe2d963d8d9b0a9a0cbf05 (diff)
parent39d8e271f42e976a61f08a4f7bc2047a682ac532 (diff)
downloadgit-eb8a1c4aed2728e1be1c5e39fb9e5a3f4b209fc4.zip
git-eb8a1c4aed2728e1be1c5e39fb9e5a3f4b209fc4.tar.gz
git-eb8a1c4aed2728e1be1c5e39fb9e5a3f4b209fc4.tar.bz2
Merge branch 'cb/maint-merge-recursive-submodule-fix' into maint
* cb/maint-merge-recursive-submodule-fix: simplify output of conflicting merge update cache for conflicting submodule entries add tests for merging with submodules
Diffstat (limited to 't')
-rwxr-xr-xt/t7405-submodule-merge.sh74
1 files changed, 74 insertions, 0 deletions
diff --git a/t/t7405-submodule-merge.sh b/t/t7405-submodule-merge.sh
new file mode 100755
index 0000000..aa6c44c
--- /dev/null
+++ b/t/t7405-submodule-merge.sh
@@ -0,0 +1,74 @@
+#!/bin/sh
+
+test_description='merging with submodules'
+
+. ./test-lib.sh
+
+#
+# history
+#
+# a --- c
+# / \ /
+# root X
+# \ / \
+# b --- d
+#
+
+test_expect_success setup '
+
+ mkdir sub &&
+ (cd sub &&
+ git init &&
+ echo original > file &&
+ git add file &&
+ test_tick &&
+ git commit -m sub-root) &&
+ git add sub &&
+ test_tick &&
+ git commit -m root &&
+
+ git checkout -b a master &&
+ (cd sub &&
+ echo A > file &&
+ git add file &&
+ test_tick &&
+ git commit -m sub-a) &&
+ git add sub &&
+ test_tick &&
+ git commit -m a &&
+
+ git checkout -b b master &&
+ (cd sub &&
+ echo B > file &&
+ git add file &&
+ test_tick &&
+ git commit -m sub-b) &&
+ git add sub &&
+ test_tick &&
+ git commit -m b
+
+ git checkout -b c a &&
+ git merge -s ours b &&
+
+ git checkout -b d b &&
+ git merge -s ours a
+'
+
+test_expect_failure 'merging with modify/modify conflict' '
+
+ git checkout -b test1 a &&
+ test_must_fail git merge b &&
+ test -f .git/MERGE_MSG &&
+ git diff
+
+'
+
+test_expect_success 'merging with a modify/modify conflict between merge bases' '
+
+ git reset --hard HEAD &&
+ git checkout -b test2 c &&
+ git merge d
+
+'
+
+test_done