3
3
test_description=' git log --graph of skewed left octopus merge.'
4
4
5
5
. ./test-lib.sh
6
+ . " $TEST_DIRECTORY " /lib-log-graph.sh
7
+
8
+ test_cmp_graph () {
9
+ cat > expect &&
10
+ lib_test_cmp_graph --color=never --date-order --format=%s " $@ "
11
+ }
6
12
7
13
test_expect_success ' set up merge history' '
8
14
test_commit initial &&
@@ -24,7 +30,7 @@ test_expect_success 'set up merge history' '
24
30
'
25
31
26
32
test_expect_success ' log --graph with tricky octopus merge, no color' '
27
- cat >expect.uncolored <<-\EOF &&
33
+ test_cmp_graph left octopus-merge <<-\EOF
28
34
* left
29
35
| *-. octopus-merge
30
36
|/|\ \
@@ -37,9 +43,6 @@ test_expect_success 'log --graph with tricky octopus merge, no color' '
37
43
|/
38
44
* initial
39
45
EOF
40
- git log --color=never --graph --date-order --pretty=tformat:%s left octopus-merge >actual.raw &&
41
- sed "s/ *\$//" actual.raw >actual &&
42
- test_cmp expect.uncolored actual
43
46
'
44
47
45
48
test_expect_success ' log --graph with tricky octopus merge with colors' '
@@ -66,7 +69,7 @@ test_expect_success 'log --graph with tricky octopus merge with colors' '
66
69
# without the first parent skewing to the "left" branch column).
67
70
68
71
test_expect_success ' log --graph with normal octopus merge, no color' '
69
- cat >expect.uncolored <<-\EOF &&
72
+ test_cmp_graph octopus-merge <<-\EOF
70
73
*---. octopus-merge
71
74
|\ \ \
72
75
| | | * 4
@@ -78,9 +81,6 @@ test_expect_success 'log --graph with normal octopus merge, no color' '
78
81
|/
79
82
* initial
80
83
EOF
81
- git log --color=never --graph --date-order --pretty=tformat:%s octopus-merge >actual.raw &&
82
- sed "s/ *\$//" actual.raw >actual &&
83
- test_cmp expect.uncolored actual
84
84
'
85
85
86
86
test_expect_success ' log --graph with normal octopus merge with colors' '
@@ -103,7 +103,7 @@ test_expect_success 'log --graph with normal octopus merge with colors' '
103
103
'
104
104
105
105
test_expect_success ' log --graph with normal octopus merge and child, no color' '
106
- cat >expect.uncolored <<-\EOF &&
106
+ test_cmp_graph after-merge <<-\EOF
107
107
* after-merge
108
108
*---. octopus-merge
109
109
|\ \ \
@@ -116,9 +116,6 @@ test_expect_success 'log --graph with normal octopus merge and child, no color'
116
116
|/
117
117
* initial
118
118
EOF
119
- git log --color=never --graph --date-order --pretty=tformat:%s after-merge >actual.raw &&
120
- sed "s/ *\$//" actual.raw >actual &&
121
- test_cmp expect.uncolored actual
122
119
'
123
120
124
121
test_expect_success ' log --graph with normal octopus and child merge with colors' '
@@ -142,7 +139,7 @@ test_expect_success 'log --graph with normal octopus and child merge with colors
142
139
'
143
140
144
141
test_expect_success ' log --graph with tricky octopus merge and its child, no color' '
145
- cat >expect.uncolored <<-\EOF &&
142
+ test_cmp_graph left after-merge <<-\EOF
146
143
* left
147
144
| * after-merge
148
145
| *-. octopus-merge
@@ -156,9 +153,6 @@ test_expect_success 'log --graph with tricky octopus merge and its child, no col
156
153
|/
157
154
* initial
158
155
EOF
159
- git log --color=never --graph --date-order --pretty=tformat:%s left after-merge >actual.raw &&
160
- sed "s/ *\$//" actual.raw >actual &&
161
- test_cmp expect.uncolored actual
162
156
'
163
157
164
158
test_expect_success ' log --graph with tricky octopus merge and its child with colors' '
@@ -183,7 +177,7 @@ test_expect_success 'log --graph with tricky octopus merge and its child with co
183
177
'
184
178
185
179
test_expect_success ' log --graph with crossover in octopus merge, no color' '
186
- cat >expect.uncolored <<-\EOF &&
180
+ test_cmp_graph after-4 octopus-merge <<-\EOF
187
181
* after-4
188
182
| *---. octopus-merge
189
183
| |\ \ \
@@ -200,9 +194,6 @@ test_expect_success 'log --graph with crossover in octopus merge, no color' '
200
194
|/
201
195
* initial
202
196
EOF
203
- git log --color=never --graph --date-order --pretty=tformat:%s after-4 octopus-merge >actual.raw &&
204
- sed "s/ *\$//" actual.raw >actual &&
205
- test_cmp expect.uncolored actual
206
197
'
207
198
208
199
test_expect_success ' log --graph with crossover in octopus merge with colors' '
@@ -230,7 +221,7 @@ test_expect_success 'log --graph with crossover in octopus merge with colors' '
230
221
'
231
222
232
223
test_expect_success ' log --graph with crossover in octopus merge and its child, no color' '
233
- cat >expect.uncolored <<-\EOF &&
224
+ test_cmp_graph after-4 after-merge <<-\EOF
234
225
* after-4
235
226
| * after-merge
236
227
| *---. octopus-merge
@@ -248,9 +239,6 @@ test_expect_success 'log --graph with crossover in octopus merge and its child,
248
239
|/
249
240
* initial
250
241
EOF
251
- git log --color=never --graph --date-order --pretty=tformat:%s after-4 after-merge >actual.raw &&
252
- sed "s/ *\$//" actual.raw >actual &&
253
- test_cmp expect.uncolored actual
254
242
'
255
243
256
244
test_expect_success ' log --graph with crossover in octopus merge and its child with colors' '
@@ -279,7 +267,7 @@ test_expect_success 'log --graph with crossover in octopus merge and its child w
279
267
'
280
268
281
269
test_expect_success ' log --graph with unrelated commit and octopus tip, no color' '
282
- cat >expect.uncolored <<-\EOF &&
270
+ test_cmp_graph after-initial octopus-merge <<-\EOF
283
271
* after-initial
284
272
| *---. octopus-merge
285
273
| |\ \ \
@@ -296,9 +284,6 @@ test_expect_success 'log --graph with unrelated commit and octopus tip, no color
296
284
|/
297
285
* initial
298
286
EOF
299
- git log --color=never --graph --date-order --pretty=tformat:%s after-initial octopus-merge >actual.raw &&
300
- sed "s/ *\$//" actual.raw >actual &&
301
- test_cmp expect.uncolored actual
302
287
'
303
288
304
289
test_expect_success ' log --graph with unrelated commit and octopus tip with colors' '
@@ -326,7 +311,7 @@ test_expect_success 'log --graph with unrelated commit and octopus tip with colo
326
311
'
327
312
328
313
test_expect_success ' log --graph with unrelated commit and octopus child, no color' '
329
- cat >expect.uncolored <<-\EOF &&
314
+ test_cmp_graph after-initial after-merge <<-\EOF
330
315
* after-initial
331
316
| * after-merge
332
317
| *---. octopus-merge
@@ -344,9 +329,6 @@ test_expect_success 'log --graph with unrelated commit and octopus child, no col
344
329
|/
345
330
* initial
346
331
EOF
347
- git log --color=never --graph --date-order --pretty=tformat:%s after-initial after-merge >actual.raw &&
348
- sed "s/ *\$//" actual.raw >actual &&
349
- test_cmp expect.uncolored actual
350
332
'
351
333
352
334
test_expect_success ' log --graph with unrelated commit and octopus child with colors' '
0 commit comments