3
3
test_description=' git log --graph of skewed merges'
4
4
5
5
. ./test-lib.sh
6
-
7
- check_graph () {
8
- cat > expect &&
9
- git log --graph --pretty=tformat:%s " $@ " > actual.raw &&
10
- sed " s/ *$//" actual.raw > actual &&
11
- test_cmp expect actual
12
- }
6
+ . " $TEST_DIRECTORY " /lib-log-graph.sh
13
7
14
8
test_expect_success ' log --graph with merge fusing with its left and right neighbors' '
15
9
git checkout --orphan _p &&
@@ -22,7 +16,7 @@ test_expect_success 'log --graph with merge fusing with its left and right neigh
22
16
git checkout _p && git merge --no-ff _r -m G &&
23
17
git checkout @^^ && git merge --no-ff _p -m H &&
24
18
25
- check_graph <<-\EOF
19
+ test_cmp_graph --pretty=tformat:%s <<-\EOF
26
20
* H
27
21
|\
28
22
| * G
@@ -50,7 +44,7 @@ test_expect_success 'log --graph with left-skewed merge' '
50
44
git checkout 0_p && git merge --no-ff 0_s -m 0_G &&
51
45
git checkout @^ && git merge --no-ff 0_q 0_r 0_t 0_p -m 0_H &&
52
46
53
- check_graph <<-\EOF
47
+ test_cmp_graph --pretty=tformat:%s <<-\EOF
54
48
*-----. 0_H
55
49
|\ \ \ \
56
50
| | | | * 0_G
@@ -84,7 +78,7 @@ test_expect_success 'log --graph with nested left-skewed merge' '
84
78
git checkout 1_p && git merge --no-ff 1_r -m 1_G &&
85
79
git checkout @^^ && git merge --no-ff 1_p -m 1_H &&
86
80
87
- check_graph <<-\EOF
81
+ test_cmp_graph --pretty=tformat:%s <<-\EOF
88
82
* 1_H
89
83
|\
90
84
| * 1_G
@@ -116,7 +110,7 @@ test_expect_success 'log --graph with nested left-skewed merge following normal
116
110
git checkout -b 2_s @^^ && git merge --no-ff 2_q -m 2_J &&
117
111
git checkout 2_p && git merge --no-ff 2_s -m 2_K &&
118
112
119
- check_graph <<-\EOF
113
+ test_cmp_graph --pretty=tformat:%s <<-\EOF
120
114
* 2_K
121
115
|\
122
116
| * 2_J
@@ -152,7 +146,7 @@ test_expect_success 'log --graph with nested right-skewed merge following left-s
152
146
git checkout 3_p && git merge --no-ff 3_r -m 3_H &&
153
147
git checkout @^^ && git merge --no-ff 3_p -m 3_J &&
154
148
155
- check_graph <<-\EOF
149
+ test_cmp_graph --pretty=tformat:%s <<-\EOF
156
150
* 3_J
157
151
|\
158
152
| * 3_H
@@ -183,7 +177,7 @@ test_expect_success 'log --graph with right-skewed merge following a left-skewed
183
177
git merge --no-ff 4_p -m 4_G &&
184
178
git checkout @^^ && git merge --no-ff 4_s -m 4_H &&
185
179
186
- check_graph --date-order <<-\EOF
180
+ test_cmp_graph --pretty=tformat:%s --date-order <<-\EOF
187
181
* 4_H
188
182
|\
189
183
| * 4_G
@@ -219,7 +213,7 @@ test_expect_success 'log --graph with octopus merge with column joining its penu
219
213
git checkout 5_r &&
220
214
git merge --no-ff 5_s -m 5_H &&
221
215
222
- check_graph <<-\EOF
216
+ test_cmp_graph --pretty=tformat:%s <<-\EOF
223
217
* 5_H
224
218
|\
225
219
| *-. 5_G
@@ -258,7 +252,7 @@ test_expect_success 'log --graph with multiple tips' '
258
252
git checkout 6_1 &&
259
253
git merge --no-ff 6_2 -m 6_I &&
260
254
261
- check_graph 6_1 6_3 6_5 <<-\EOF
255
+ test_cmp_graph --pretty=tformat:%s 6_1 6_3 6_5 <<-\EOF
262
256
* 6_I
263
257
|\
264
258
| | * 6_H
@@ -337,7 +331,7 @@ test_expect_success 'log --graph with multiple tips' '
337
331
git checkout -b M_7 7_1 &&
338
332
git merge --no-ff 7_2 7_3 -m 7_M4 &&
339
333
340
- check_graph M_1 M_3 M_5 M_7 <<-\EOF
334
+ test_cmp_graph --pretty=tformat:%s M_1 M_3 M_5 M_7 <<-\EOF
341
335
* 7_M1
342
336
|\
343
337
| | * 7_M2
0 commit comments