]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/t5411/test-0000-standard-git-push.sh
t5411: refactor check of refs using test_cmp_refs
[thirdparty/git.git] / t / t5411 / test-0000-standard-git-push.sh
index bdc4907191084cf69fe5aa16f8bb99a3ed1d0814..e1e0175c125d034850fd42e293a04d5e2a46bd4b 100644 (file)
@@ -19,13 +19,11 @@ test_expect_success "git-push ($PROTOCOL)" '
         * [new branch] HEAD -> next
        EOF
        test_cmp expect actual &&
-       git -C "$upstream" show-ref >out &&
-       make_user_friendly_and_stable_output <out >actual &&
-       cat >expect <<-EOF &&
+
+       test_cmp_refs -C "$upstream" <<-EOF
        <COMMIT-B> refs/heads/main
        <COMMIT-A> refs/heads/next
        EOF
-       test_cmp expect actual
 '
 
 # Refs of upstream : main(B)  next(A)
@@ -46,13 +44,11 @@ test_expect_success "git-push --atomic ($PROTOCOL)" '
         ! [rejected] <COMMIT-B> -> next (atomic push failed)
        EOF
        test_cmp expect actual &&
-       git -C "$upstream" show-ref >out &&
-       make_user_friendly_and_stable_output <out >actual &&
-       cat >expect <<-EOF &&
+
+       test_cmp_refs -C "$upstream" <<-EOF
        <COMMIT-B> refs/heads/main
        <COMMIT-A> refs/heads/next
        EOF
-       test_cmp expect actual
 '
 
 # Refs of upstream : main(B)  next(A)
@@ -77,13 +73,11 @@ test_expect_success "non-fast-forward git-push ($PROTOCOL)" '
         ! [rejected] main -> main (non-fast-forward)
        EOF
        test_cmp expect actual &&
-       git -C "$upstream" show-ref >out &&
-       make_user_friendly_and_stable_output <out >actual &&
-       cat >expect <<-EOF &&
+
+       test_cmp_refs -C "$upstream" <<-EOF
        <COMMIT-B> refs/heads/main
        <COMMIT-B> refs/heads/next
        EOF
-       test_cmp expect actual
 '
 
 # Refs of upstream : main(B)  next(B)
@@ -119,15 +113,13 @@ test_expect_success "git-push -f ($PROTOCOL)" '
         * [new branch] HEAD -> a/b/c
        EOF
        test_cmp expect actual &&
-       git -C "$upstream" show-ref >out &&
-       make_user_friendly_and_stable_output <out >actual &&
-       cat >expect <<-EOF &&
+
+       test_cmp_refs -C "$upstream" <<-EOF
        <COMMIT-A> refs/heads/a/b/c
        <COMMIT-A> refs/heads/main
        <COMMIT-A> refs/review/main/topic
        <TAG-v123> refs/tags/v123
        EOF
-       test_cmp expect actual
 '
 
 # Refs of upstream : main(A)  tags/v123  refs/review/main/topic(A)  a/b/c(A)