@@ -34,12 +34,9 @@ test_expect_success "proc-receive: bad protocol (unknown version, $PROTOCOL)" '
3434 EOF
3535 test_cmp expect actual-error &&
3636
37- git -C "$upstream" show-ref >out &&
38- make_user_friendly_and_stable_output <out >actual &&
39- cat >expect <<-EOF &&
37+ test_cmp_refs -C "$upstream" <<-EOF
4038 <COMMIT-A> refs/heads/main
4139 EOF
42- test_cmp expect actual
4340'
4441
4542test_expect_success " setup proc-receive hook (hook --die-read-version, $PROTOCOL )" '
@@ -68,12 +65,9 @@ test_expect_success "proc-receive: bad protocol (hook --die-read-version, $PROTO
6865 grep "remote: fatal: die with the --die-read-version option" out-$test_count &&
6966 grep "remote: error: fail to negotiate version with proc-receive hook" out-$test_count &&
7067
71- git -C "$upstream" show-ref >out &&
72- make_user_friendly_and_stable_output <out >actual &&
73- cat >expect <<-EOF &&
68+ test_cmp_refs -C "$upstream" <<-EOF
7469 <COMMIT-A> refs/heads/main
7570 EOF
76- test_cmp expect actual
7771'
7872
7973test_expect_success " setup proc-receive hook (hook --die-write-version, $PROTOCOL )" '
@@ -102,12 +96,9 @@ test_expect_success "proc-receive: bad protocol (hook --die-write-version, $PROT
10296 grep "remote: fatal: die with the --die-write-version option" out-$test_count &&
10397 grep "remote: error: fail to negotiate version with proc-receive hook" out-$test_count &&
10498
105- git -C "$upstream" show-ref >out &&
106- make_user_friendly_and_stable_output <out >actual &&
107- cat >expect <<-EOF &&
99+ test_cmp_refs -C "$upstream" <<-EOF
108100 <COMMIT-A> refs/heads/main
109101 EOF
110- test_cmp expect actual
111102'
112103
113104test_expect_success " setup proc-receive hook (hook --die-read-commands, $PROTOCOL )" '
@@ -135,12 +126,9 @@ test_expect_success "proc-receive: bad protocol (hook --die-read-commands, $PROT
135126 test_cmp expect actual &&
136127 grep "remote: fatal: die with the --die-read-commands option" out-$test_count &&
137128
138- git -C "$upstream" show-ref >out &&
139- make_user_friendly_and_stable_output <out >actual &&
140- cat >expect <<-EOF &&
129+ test_cmp_refs -C "$upstream" <<-EOF
141130 <COMMIT-A> refs/heads/main
142131 EOF
143- test_cmp expect actual
144132'
145133
146134test_expect_success " setup proc-receive hook (hook --die-read-push-options, $PROTOCOL )" '
@@ -170,12 +158,9 @@ test_expect_success "proc-receive: bad protocol (hook --die-read-push-options, $
170158 test_cmp expect actual &&
171159 grep "remote: fatal: die with the --die-read-push-options option" out-$test_count &&
172160
173- git -C "$upstream" show-ref >out &&
174- make_user_friendly_and_stable_output <out >actual &&
175- cat >expect <<-EOF &&
161+ test_cmp_refs -C "$upstream" <<-EOF
176162 <COMMIT-A> refs/heads/main
177163 EOF
178- test_cmp expect actual
179164'
180165
181166test_expect_success " setup proc-receive hook (hook --die-write-report, $PROTOCOL )" '
@@ -203,12 +188,9 @@ test_expect_success "proc-receive: bad protocol (hook --die-write-report, $PROTO
203188 test_cmp expect actual &&
204189 grep "remote: fatal: die with the --die-write-report option" out-$test_count &&
205190
206- git -C "$upstream" show-ref >out &&
207- make_user_friendly_and_stable_output <out >actual &&
208- cat >expect <<-EOF &&
191+ test_cmp_refs -C "$upstream" <<-EOF
209192 <COMMIT-A> refs/heads/main
210193 EOF
211- test_cmp expect actual
212194'
213195
214196test_expect_success " setup proc-receive hook (no report, $PROTOCOL )" '
@@ -240,13 +222,10 @@ test_expect_success "proc-receive: bad protocol (no report, $PROTOCOL)" '
240222 EOF
241223 test_cmp expect actual &&
242224
243- git -C "$upstream" show-ref >out &&
244- make_user_friendly_and_stable_output <out >actual &&
245- cat >expect <<-EOF &&
225+ test_cmp_refs -C "$upstream" <<-EOF
246226 <COMMIT-A> refs/heads/main
247227 <COMMIT-A> refs/heads/next
248228 EOF
249- test_cmp expect actual
250229'
251230
252231# Refs of upstream : main(A) next(A)
@@ -284,12 +263,9 @@ test_expect_success "proc-receive: bad protocol (no ref, $PROTOCOL)" '
284263 EOF
285264 test_cmp expect actual &&
286265
287- git -C "$upstream" show-ref >out &&
288- make_user_friendly_and_stable_output <out >actual &&
289- cat >expect <<-EOF &&
266+ test_cmp_refs -C "$upstream" <<-EOF
290267 <COMMIT-A> refs/heads/main
291268 EOF
292- test_cmp expect actual
293269'
294270
295271test_expect_success " setup proc-receive hook (unknown status, $PROTOCOL )" '
@@ -320,10 +296,7 @@ test_expect_success "proc-receive: bad protocol (unknown status, $PROTOCOL)" '
320296 EOF
321297 test_cmp expect actual &&
322298
323- git -C "$upstream" show-ref >out &&
324- make_user_friendly_and_stable_output <out >actual &&
325- cat >expect <<-EOF &&
299+ test_cmp_refs -C "$upstream" <<-EOF
326300 <COMMIT-A> refs/heads/main
327301 EOF
328- test_cmp expect actual
329302'
0 commit comments