summaryrefslogtreecommitdiff
path: root/t/t5548-push-porcelain.sh
diff options
context:
space:
mode:
authorLibravatar Jiang Xin <zhiyou.jx@alibaba-inc.com>2020-04-17 05:45:35 -0400
committerLibravatar Junio C Hamano <gitster@pobox.com>2020-04-17 12:16:32 -0700
commitf38b16843dcbb575803dfeab39a4172b7469411d (patch)
treeb01a7e8275694f9c0c5e6d84dc79d62ed83d9ff7 /t/t5548-push-porcelain.sh
parentsend-pack: mark failure of atomic push properly (diff)
downloadtgif-f38b16843dcbb575803dfeab39a4172b7469411d.tar.xz
transport-helper: mark failure for atomic push
Commit v2.22.0-1-g3bca1e7f9f (transport-helper: enforce atomic in push_refs_with_push, 2019-07-11) noticed the incomplete report of failure of an atomic push for HTTP protocol. But the implementation has a flaw that mark all remote references as failure. Only mark necessary references as failure in `push_refs_with_push()` of transport-helper. Signed-off-by: Jiang Xin <zhiyou.jx@alibaba-inc.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5548-push-porcelain.sh')
-rwxr-xr-xt/t5548-push-porcelain.sh5
1 files changed, 2 insertions, 3 deletions
diff --git a/t/t5548-push-porcelain.sh b/t/t5548-push-porcelain.sh
index 9f4b7de74b..1b19b3ef55 100755
--- a/t/t5548-push-porcelain.sh
+++ b/t/t5548-push-porcelain.sh
@@ -136,7 +136,7 @@ run_git_push_porcelain_output_test() {
# Refs of upstream : master(A) bar(B) baz(A) next(A)
# Refs of workbench: master(B) bar(A) baz(A) next(A)
# git-push : master(B) bar(A) NULL next(A)
- test_expect_failure "atomic push failed ($PROTOCOL)" '
+ test_expect_success "atomic push failed ($PROTOCOL)" '
(
cd workbench &&
git update-ref refs/heads/master $B &&
@@ -150,10 +150,10 @@ run_git_push_porcelain_output_test() {
make_user_friendly_and_stable_output <out >actual &&
cat >expect <<-EOF &&
To <URL/of/upstream.git>
+ = refs/heads/next:refs/heads/next [up to date]
! refs/heads/bar:refs/heads/bar [rejected] (non-fast-forward)
! (delete):refs/heads/baz [rejected] (atomic push failed)
! refs/heads/master:refs/heads/master [rejected] (atomic push failed)
- ! refs/heads/next:refs/heads/next [rejected] (atomic push failed)
Done
EOF
test_cmp expect actual &&
@@ -168,7 +168,6 @@ run_git_push_porcelain_output_test() {
EOF
test_cmp expect actual
'
-
test_expect_success "prepare pre-receive hook ($PROTOCOL)" '
write_script "$upstream/hooks/pre-receive" <<-EOF
exit 1