Skip to content

Commit 853608f

Browse files
abhishekkumar2718gitster
authored andcommitted
t4215: 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 5c1821f commit 853608f

File tree

1 file changed

+10
-16
lines changed

1 file changed

+10
-16
lines changed

t/t4215-log-skewed-merges.sh

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,7 @@
33
test_description='git log --graph of skewed merges'
44

55
. ./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
137

148
test_expect_success 'log --graph with merge fusing with its left and right neighbors' '
159
git checkout --orphan _p &&
@@ -22,7 +16,7 @@ test_expect_success 'log --graph with merge fusing with its left and right neigh
2216
git checkout _p && git merge --no-ff _r -m G &&
2317
git checkout @^^ && git merge --no-ff _p -m H &&
2418
25-
check_graph <<-\EOF
19+
test_cmp_graph --pretty=tformat:%s <<-\EOF
2620
* H
2721
|\
2822
| * G
@@ -50,7 +44,7 @@ test_expect_success 'log --graph with left-skewed merge' '
5044
git checkout 0_p && git merge --no-ff 0_s -m 0_G &&
5145
git checkout @^ && git merge --no-ff 0_q 0_r 0_t 0_p -m 0_H &&
5246
53-
check_graph <<-\EOF
47+
test_cmp_graph --pretty=tformat:%s <<-\EOF
5448
*-----. 0_H
5549
|\ \ \ \
5650
| | | | * 0_G
@@ -84,7 +78,7 @@ test_expect_success 'log --graph with nested left-skewed merge' '
8478
git checkout 1_p && git merge --no-ff 1_r -m 1_G &&
8579
git checkout @^^ && git merge --no-ff 1_p -m 1_H &&
8680
87-
check_graph <<-\EOF
81+
test_cmp_graph --pretty=tformat:%s <<-\EOF
8882
* 1_H
8983
|\
9084
| * 1_G
@@ -116,7 +110,7 @@ test_expect_success 'log --graph with nested left-skewed merge following normal
116110
git checkout -b 2_s @^^ && git merge --no-ff 2_q -m 2_J &&
117111
git checkout 2_p && git merge --no-ff 2_s -m 2_K &&
118112
119-
check_graph <<-\EOF
113+
test_cmp_graph --pretty=tformat:%s <<-\EOF
120114
* 2_K
121115
|\
122116
| * 2_J
@@ -152,7 +146,7 @@ test_expect_success 'log --graph with nested right-skewed merge following left-s
152146
git checkout 3_p && git merge --no-ff 3_r -m 3_H &&
153147
git checkout @^^ && git merge --no-ff 3_p -m 3_J &&
154148
155-
check_graph <<-\EOF
149+
test_cmp_graph --pretty=tformat:%s <<-\EOF
156150
* 3_J
157151
|\
158152
| * 3_H
@@ -183,7 +177,7 @@ test_expect_success 'log --graph with right-skewed merge following a left-skewed
183177
git merge --no-ff 4_p -m 4_G &&
184178
git checkout @^^ && git merge --no-ff 4_s -m 4_H &&
185179
186-
check_graph --date-order <<-\EOF
180+
test_cmp_graph --pretty=tformat:%s --date-order <<-\EOF
187181
* 4_H
188182
|\
189183
| * 4_G
@@ -219,7 +213,7 @@ test_expect_success 'log --graph with octopus merge with column joining its penu
219213
git checkout 5_r &&
220214
git merge --no-ff 5_s -m 5_H &&
221215
222-
check_graph <<-\EOF
216+
test_cmp_graph --pretty=tformat:%s <<-\EOF
223217
* 5_H
224218
|\
225219
| *-. 5_G
@@ -258,7 +252,7 @@ test_expect_success 'log --graph with multiple tips' '
258252
git checkout 6_1 &&
259253
git merge --no-ff 6_2 -m 6_I &&
260254
261-
check_graph 6_1 6_3 6_5 <<-\EOF
255+
test_cmp_graph --pretty=tformat:%s 6_1 6_3 6_5 <<-\EOF
262256
* 6_I
263257
|\
264258
| | * 6_H
@@ -337,7 +331,7 @@ test_expect_success 'log --graph with multiple tips' '
337331
git checkout -b M_7 7_1 &&
338332
git merge --no-ff 7_2 7_3 -m 7_M4 &&
339333
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
341335
* 7_M1
342336
|\
343337
| | * 7_M2

0 commit comments

Comments
 (0)