add tests for merging with submodules
Signed-off-by: Clemens Buchacher <drizzd@aon.at> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Clemens Buchacher committed
Apr 5, 2009 at 02:46 UTC
f37ae35e73dbc492bd3ca24badb309817ecaaa67
1 file changed
+74
t/t7405-submodule-merge.sh
new
+74
@@ -0,0 +1,74 @@
1
+#!/bin/sh
2
+
3
+test_description='merging with submodules'
4
+
5
+. ./test-lib.sh
6
+
7
+#
8
+# history
9
+#
10
+# a --- c
11
+# / \ /
12
+# root X
13
+# \ / \
14
+# b --- d
15
+#
16
+
17
+test_expect_success setup '
18
+
19
+ mkdir sub &&
20
+ (cd sub &&
21
+ git init &&
22
+ echo original > file &&
23
+ git add file &&
24
+ test_tick &&
25
+ git commit -m sub-root) &&
26
+ git add sub &&
27
+ test_tick &&
28
+ git commit -m root &&
29
+
30
+ git checkout -b a master &&
31
+ (cd sub &&
32
+ echo A > file &&
33
+ git add file &&
34
+ test_tick &&
35
+ git commit -m sub-a) &&
36
+ git add sub &&
37
+ test_tick &&
38
+ git commit -m a &&
39
+
40
+ git checkout -b b master &&
41
+ (cd sub &&
42
+ echo B > file &&
43
+ git add file &&
44
+ test_tick &&
45
+ git commit -m sub-b) &&
46
+ git add sub &&
47
+ test_tick &&
48
+ git commit -m b
49
+
50
+ git checkout -b c a &&
51
+ git merge -s ours b &&
52
+
53
+ git checkout -b d b &&
54
+ git merge -s ours a
55
+'
56
+
57
+test_expect_failure 'merging with modify/modify conflict' '
58
+
59
+ git checkout -b test1 a &&
60
+ test_must_fail git merge b &&
61
+ test -f .git/MERGE_MSG &&
62
+ git diff
63
+
64
+'
65
+
66
+test_expect_failure 'merging with a modify/modify conflict between merge bases' '
67
+
68
+ git reset --hard HEAD &&
69
+ git checkout -b test2 c &&
70
+ git merge d
71
+
72
+'
73
+
74
+test_done