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
| | #!/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_done
|