Skip to content

Commit 5c1821f

Browse files
abhishekkumar2718gitster
authored andcommitted
t3430: use lib-log-graph functions
Helped-by: Johannes Schindelin <[email protected]> Signed-off-by: Abhishek Kumar <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 91c88eb commit 5c1821f

File tree

1 file changed

+9
-15
lines changed

1 file changed

+9
-15
lines changed

t/t3430-rebase-merges.sh

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,7 @@ Initial setup:
2020
'
2121
. ./test-lib.sh
2222
. "$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
3024

3125
test_expect_success 'setup' '
3226
write_script replace-editor.sh <<-\EOF &&
@@ -84,7 +78,7 @@ test_expect_success 'create completely different structure' '
8478
test_config sequence.editor \""$PWD"/replace-editor.sh\" &&
8579
test_tick &&
8680
git rebase -i -r A master &&
87-
test_cmp_graph <<-\EOF
81+
test_cmp_graph --pretty=tformat:%s --boundary <<-\EOF
8882
* Merge the topic branch '\''onebranch'\''
8983
|\
9084
| * D
@@ -201,7 +195,7 @@ test_expect_success 'with a branch tip that was cherry-picked already' '
201195
git checkout already-upstream &&
202196
test_tick &&
203197
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
205199
* Merge branch A
206200
|\
207201
| * A1
@@ -219,7 +213,7 @@ test_expect_success 'do not rebase cousins unless asked for' '
219213
test_cmp_rev HEAD $before &&
220214
test_tick &&
221215
git rebase --rebase-merges=rebase-cousins HEAD^ &&
222-
test_cmp_graph HEAD^.. <<-\EOF
216+
test_cmp_graph --pretty=tformat:%s --boundary HEAD^.. <<-\EOF
223217
* Merge the topic branch '\''onebranch'\''
224218
|\
225219
| * D
@@ -311,7 +305,7 @@ test_expect_success 'root commits' '
311305
test $(git rev-parse second-root^0) != $(git rev-parse HEAD^) &&
312306
test $(git rev-parse second-root:second-root.t) = \
313307
$(git rev-parse HEAD^:second-root.t) &&
314-
test_cmp_graph HEAD <<-\EOF &&
308+
test_cmp_graph --pretty=tformat:%s --boundary HEAD <<-\EOF &&
315309
* Merge the 3rd root
316310
|\
317311
| * third-root
@@ -347,15 +341,15 @@ test_expect_success 'A root commit can be a cousin, treat it that way' '
347341
test_tick &&
348342
git rebase -f -r HEAD^ &&
349343
test_cmp_rev ! HEAD^2 khnum &&
350-
test_cmp_graph HEAD^.. <<-\EOF &&
344+
test_cmp_graph --pretty=tformat:%s --boundary HEAD^.. <<-\EOF &&
351345
* Merge branch '\''khnum'\'' into asherah
352346
|\
353347
| * yama
354348
o shamkat
355349
EOF
356350
test_tick &&
357351
git rebase --rebase-merges=rebase-cousins HEAD^ &&
358-
test_cmp_graph HEAD^.. <<-\EOF
352+
test_cmp_graph --pretty=tformat:%s --boundary HEAD^.. <<-\EOF
359353
* Merge branch '\''khnum'\'' into asherah
360354
|\
361355
| * yama
@@ -402,7 +396,7 @@ test_expect_success 'octopus merges' '
402396
git rebase -i --force-rebase -r HEAD^^ &&
403397
test "Hank" = "$(git show -s --format=%an HEAD)" &&
404398
test "$before" != $(git rev-parse HEAD) &&
405-
test_cmp_graph HEAD^^.. <<-\EOF
399+
test_cmp_graph --pretty=tformat:%s --boundary HEAD^^.. <<-\EOF
406400
*-. Tüntenfüsch
407401
|\ \
408402
| | * three
@@ -478,7 +472,7 @@ test_expect_success '--rebase-merges with message matched with onto label' '
478472
git checkout -b onto-label E &&
479473
git merge -m onto G &&
480474
git rebase --rebase-merges --force-rebase E &&
481-
test_cmp_graph <<-\EOF
475+
test_cmp_graph --pretty=tformat:%s --boundary <<-\EOF
482476
* onto
483477
|\
484478
| * G

0 commit comments

Comments
 (0)