@@ -20,13 +20,7 @@ Initial setup:
20
20
'
21
21
. ./test-lib.sh
22
22
. " $TEST_DIRECTORY " /lib-rebase.sh
23
-
24
- test_cmp_graph () {
25
- cat > expect &&
26
- git log --graph --boundary --format=%s " $@ " > output &&
27
- sed " s/ *$//" < output > output.trimmed &&
28
- test_cmp expect output.trimmed
29
- }
23
+ . " $TEST_DIRECTORY " /lib-log-graph.sh
30
24
31
25
test_expect_success ' setup' '
32
26
write_script replace-editor.sh <<-\EOF &&
@@ -84,7 +78,7 @@ test_expect_success 'create completely different structure' '
84
78
test_config sequence.editor \""$PWD"/replace-editor.sh\" &&
85
79
test_tick &&
86
80
git rebase -i -r A master &&
87
- test_cmp_graph <<-\EOF
81
+ test_cmp_graph --pretty=tformat:%s --boundary <<-\EOF
88
82
* Merge the topic branch ' \' ' onebranch' \' '
89
83
|\
90
84
| * D
@@ -201,7 +195,7 @@ test_expect_success 'with a branch tip that was cherry-picked already' '
201
195
git checkout already-upstream &&
202
196
test_tick &&
203
197
git rebase -i -r upstream-with-a2 &&
204
- test_cmp_graph upstream-with-a2.. <<-\EOF
198
+ test_cmp_graph --pretty=tformat:%s --boundary upstream-with-a2.. <<-\EOF
205
199
* Merge branch A
206
200
|\
207
201
| * A1
@@ -219,7 +213,7 @@ test_expect_success 'do not rebase cousins unless asked for' '
219
213
test_cmp_rev HEAD $before &&
220
214
test_tick &&
221
215
git rebase --rebase-merges=rebase-cousins HEAD^ &&
222
- test_cmp_graph HEAD^.. <<-\EOF
216
+ test_cmp_graph --pretty=tformat:%s --boundary HEAD^.. <<-\EOF
223
217
* Merge the topic branch ' \' ' onebranch' \' '
224
218
|\
225
219
| * D
@@ -311,7 +305,7 @@ test_expect_success 'root commits' '
311
305
test $(git rev-parse second-root^0) != $(git rev-parse HEAD^) &&
312
306
test $(git rev-parse second-root:second-root.t) = \
313
307
$(git rev-parse HEAD^:second-root.t) &&
314
- test_cmp_graph HEAD <<-\EOF &&
308
+ test_cmp_graph --pretty=tformat:%s --boundary HEAD <<-\EOF &&
315
309
* Merge the 3rd root
316
310
|\
317
311
| * third-root
@@ -347,15 +341,15 @@ test_expect_success 'A root commit can be a cousin, treat it that way' '
347
341
test_tick &&
348
342
git rebase -f -r HEAD^ &&
349
343
test_cmp_rev ! HEAD^2 khnum &&
350
- test_cmp_graph HEAD^.. <<-\EOF &&
344
+ test_cmp_graph --pretty=tformat:%s --boundary HEAD^.. <<-\EOF &&
351
345
* Merge branch ' \' ' khnum' \' ' into asherah
352
346
|\
353
347
| * yama
354
348
o shamkat
355
349
EOF
356
350
test_tick &&
357
351
git rebase --rebase-merges=rebase-cousins HEAD^ &&
358
- test_cmp_graph HEAD^.. <<-\EOF
352
+ test_cmp_graph --pretty=tformat:%s --boundary HEAD^.. <<-\EOF
359
353
* Merge branch ' \' ' khnum' \' ' into asherah
360
354
|\
361
355
| * yama
@@ -402,7 +396,7 @@ test_expect_success 'octopus merges' '
402
396
git rebase -i --force-rebase -r HEAD^^ &&
403
397
test "Hank" = "$(git show -s --format=%an HEAD)" &&
404
398
test "$before" != $(git rev-parse HEAD) &&
405
- test_cmp_graph HEAD^^.. <<-\EOF
399
+ test_cmp_graph --pretty=tformat:%s --boundary HEAD^^.. <<-\EOF
406
400
*-. Tüntenfüsch
407
401
|\ \
408
402
| | * three
@@ -478,7 +472,7 @@ test_expect_success '--rebase-merges with message matched with onto label' '
478
472
git checkout -b onto-label E &&
479
473
git merge -m onto G &&
480
474
git rebase --rebase-merges --force-rebase E &&
481
- test_cmp_graph <<-\EOF
475
+ test_cmp_graph --pretty=tformat:%s --boundary <<-\EOF
482
476
* onto
483
477
|\
484
478
| * G
0 commit comments