@@ -10,6 +10,10 @@ test_cmp_graph () {
10
10
lib_test_cmp_graph --color=never --date-order --format=%s " $@ "
11
11
}
12
12
13
+ test_cmp_colored_graph () {
14
+ lib_test_cmp_colored_graph --date-order --format=%s " $@ "
15
+ }
16
+
13
17
test_expect_success ' set up merge history' '
14
18
test_commit initial &&
15
19
for i in 1 2 3 4 ; do
@@ -60,9 +64,7 @@ test_expect_success 'log --graph with tricky octopus merge with colors' '
60
64
<MAGENTA>|<RESET><MAGENTA>/<RESET>
61
65
* initial
62
66
EOF
63
- git log --color=always --graph --date-order --pretty=tformat:%s left octopus-merge >actual.colors.raw &&
64
- test_decode_color <actual.colors.raw | sed "s/ *\$//" >actual.colors &&
65
- test_cmp expect.colors actual.colors
67
+ test_cmp_colored_graph left octopus-merge
66
68
'
67
69
68
70
# Repeat the previous two tests with "normal" octopus merge (i.e.,
@@ -97,9 +99,7 @@ test_expect_success 'log --graph with normal octopus merge with colors' '
97
99
* initial
98
100
EOF
99
101
test_config log.graphColors red,green,yellow,blue,magenta,cyan &&
100
- git log --color=always --graph --date-order --pretty=tformat:%s octopus-merge >actual.colors.raw &&
101
- test_decode_color <actual.colors.raw | sed "s/ *\$//" >actual.colors &&
102
- test_cmp expect.colors actual.colors
102
+ test_cmp_colored_graph octopus-merge
103
103
'
104
104
105
105
test_expect_success ' log --graph with normal octopus merge and child, no color' '
@@ -133,9 +133,7 @@ test_expect_success 'log --graph with normal octopus and child merge with colors
133
133
* initial
134
134
EOF
135
135
test_config log.graphColors red,green,yellow,blue,magenta,cyan &&
136
- git log --color=always --graph --date-order --pretty=tformat:%s after-merge >actual.colors.raw &&
137
- test_decode_color <actual.colors.raw | sed "s/ *\$//" >actual.colors &&
138
- test_cmp expect.colors actual.colors
136
+ test_cmp_colored_graph after-merge
139
137
'
140
138
141
139
test_expect_success ' log --graph with tricky octopus merge and its child, no color' '
@@ -171,9 +169,7 @@ test_expect_success 'log --graph with tricky octopus merge and its child with co
171
169
<CYAN>|<RESET><CYAN>/<RESET>
172
170
* initial
173
171
EOF
174
- git log --color=always --graph --date-order --pretty=tformat:%s left after-merge >actual.colors.raw &&
175
- test_decode_color <actual.colors.raw | sed "s/ *\$//" >actual.colors &&
176
- test_cmp expect.colors actual.colors
172
+ test_cmp_colored_graph left after-merge
177
173
'
178
174
179
175
test_expect_success ' log --graph with crossover in octopus merge, no color' '
@@ -215,9 +211,7 @@ test_expect_success 'log --graph with crossover in octopus merge with colors' '
215
211
<MAGENTA>|<RESET><MAGENTA>/<RESET>
216
212
* initial
217
213
EOF
218
- git log --color=always --graph --date-order --pretty=tformat:%s after-4 octopus-merge >actual.colors.raw &&
219
- test_decode_color <actual.colors.raw | sed "s/ *\$//" >actual.colors &&
220
- test_cmp expect.colors actual.colors
214
+ test_cmp_colored_graph after-4 octopus-merge
221
215
'
222
216
223
217
test_expect_success ' log --graph with crossover in octopus merge and its child, no color' '
@@ -261,9 +255,7 @@ test_expect_success 'log --graph with crossover in octopus merge and its child w
261
255
<CYAN>|<RESET><CYAN>/<RESET>
262
256
* initial
263
257
EOF
264
- git log --color=always --graph --date-order --pretty=tformat:%s after-4 after-merge >actual.colors.raw &&
265
- test_decode_color <actual.colors.raw | sed "s/ *\$//" >actual.colors &&
266
- test_cmp expect.colors actual.colors
258
+ test_cmp_colored_graph after-4 after-merge
267
259
'
268
260
269
261
test_expect_success ' log --graph with unrelated commit and octopus tip, no color' '
@@ -305,9 +297,7 @@ test_expect_success 'log --graph with unrelated commit and octopus tip with colo
305
297
<RED>|<RESET><RED>/<RESET>
306
298
* initial
307
299
EOF
308
- git log --color=always --graph --date-order --pretty=tformat:%s after-initial octopus-merge >actual.colors.raw &&
309
- test_decode_color <actual.colors.raw | sed "s/ *\$//" >actual.colors &&
310
- test_cmp expect.colors actual.colors
300
+ test_cmp_colored_graph after-initial octopus-merge
311
301
'
312
302
313
303
test_expect_success ' log --graph with unrelated commit and octopus child, no color' '
@@ -351,9 +341,7 @@ test_expect_success 'log --graph with unrelated commit and octopus child with co
351
341
<RED>|<RESET><RED>/<RESET>
352
342
* initial
353
343
EOF
354
- git log --color=always --graph --date-order --pretty=tformat:%s after-initial after-merge >actual.colors.raw &&
355
- test_decode_color <actual.colors.raw | sed "s/ *\$//" >actual.colors &&
356
- test_cmp expect.colors actual.colors
344
+ test_cmp_colored_graph after-initial after-merge
357
345
'
358
346
359
347
test_done
0 commit comments