summaryrefslogtreecommitdiff
path: root/t/t5411/test-0000-standard-git-push.sh
diff options
context:
space:
mode:
Diffstat (limited to 't/t5411/test-0000-standard-git-push.sh')
-rw-r--r--t/t5411/test-0000-standard-git-push.sh32
1 files changed, 12 insertions, 20 deletions
diff --git a/t/t5411/test-0000-standard-git-push.sh b/t/t5411/test-0000-standard-git-push.sh
index 47b058af7e..e1e0175c12 100644
--- a/t/t5411/test-0000-standard-git-push.sh
+++ b/t/t5411/test-0000-standard-git-push.sh
@@ -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)
@@ -35,24 +33,22 @@ test_expect_success "git-push --atomic ($PROTOCOL)" '
test_must_fail git -C workbench push --atomic origin \
main \
$B:refs/heads/next \
- >out 2>&1 &&
+ >out-$test_count 2>&1 &&
filter_out_user_friendly_and_stable_output \
-e "/^To / { p; }" \
-e "/^ ! / { p; }" \
- <out >actual &&
+ <out-$test_count >actual &&
cat >expect <<-EOF &&
To <URL/of/upstream.git>
! [rejected] main -> main (non-fast-forward)
! [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)
@@ -65,8 +61,8 @@ test_expect_success "non-fast-forward git-push ($PROTOCOL)" '
push origin \
main \
$B:refs/heads/next \
- >out 2>&1 &&
- make_user_friendly_and_stable_output <out >actual &&
+ >out-$test_count 2>&1 &&
+ make_user_friendly_and_stable_output <out-$test_count >actual &&
cat >expect <<-EOF &&
remote: # pre-receive hook
remote: pre-receive< <COMMIT-A> <COMMIT-B> refs/heads/next
@@ -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)