1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
| | #!/bin/sh
test_description='merge style conflict markers configurations'
. ./test-lib.sh
fill () {
for i
do
echo "$i"
done
}
test_expect_success 'merge' '
test_create_repo merge &&
(
cd merge &&
fill 1 2 3 >content &&
git add content &&
git commit -m base &&
git checkout -b r &&
echo six >>content &&
git commit -a -m right &&
git checkout master &&
echo 7 >>content &&
git commit -a -m left &&
test_must_fail git merge r &&
! grep -E "\|+" content &&
git reset --hard &&
test_must_fail git -c merge.conflictstyle=diff3 merge r &&
grep -E "\|+" content &&
git reset --hard &&
test_must_fail git -c merge.conflictstyle=merge merge r &&
! grep -E "\|+" content
)
'
test_expect_success 'merge-tree' '
test_create_repo merge-tree &&
(
cd merge-tree &&
test_commit initial initial-file initial &&
test_commit r content r &&
git reset --hard initial &&
test_commit l content l &&
git merge-tree initial r l >actual &&
! grep -E "\|+" actual &&
git -c merge.conflictstyle=diff3 merge-tree initial r l >actual &&
grep -E "\|+" actual &&
git -c merge.conflictstyle=merge merge-tree initial r l >actual &&
! grep -E "\|+" actual
)
'
test_expect_success 'notes' '
test_create_repo notes &&
(
test_commit initial &&
git -c core.notesRef=refs/notes/b notes add -m b initial &&
git update-ref refs/notes/r refs/notes/b &&
git -c core.notesRef=refs/notes/r notes add -f -m r initial &&
git update-ref refs/notes/l refs/notes/b &&
git config core.notesRef refs/notes/l &&
git notes add -f -m l initial &&
test_must_fail git notes merge r &&
! grep -E "\|+" .git/NOTES_MERGE_WORKTREE/* &&
git notes merge --abort &&
test_must_fail git -c merge.conflictstyle=diff3 notes merge r &&
grep -E "\|+" .git/NOTES_MERGE_WORKTREE/* &&
git notes merge --abort &&
test_must_fail git -c merge.conflictstyle=merge notes merge r &&
! grep -E "\|+" .git/NOTES_MERGE_WORKTREE/*
)
'
test_expect_success 'checkout' '
test_create_repo checkout &&
(
test_commit checkout &&
fill a b c d e >content &&
git add content &&
git commit -m initial &&
git checkout -b simple master &&
fill a c e >content &&
git commit -a -m simple &&
fill b d >content &&
git checkout --merge master &&
! grep -E "\|+" content &&
git config merge.conflictstyle merge &&
git checkout -f simple &&
fill b d >content &&
git checkout --merge --conflict=diff3 master &&
grep -E "\|+" content &&
git checkout -f simple &&
fill b d >content &&
git checkout --merge --conflict=merge master &&
! grep -E "\|+" content
)
'
test_done
|