@@ -332,6 +332,8 @@ static int atomic_push_failure(struct send_pack_args *args,
continue;
switch (ref->status) {
+ case REF_STATUS_NONE:
+ case REF_STATUS_OK:
case REF_STATUS_EXPECTING_REPORT:
ref->status = REF_STATUS_ATOMIC_PUSH_FAILED;
continue;
@@ -177,7 +177,7 @@ test_expect_success 'push (chunked)' '
test $HEAD = $(git rev-parse --verify HEAD))
'
-test_expect_success 'push --atomic also prevents branch creation, reports collateral' '
+test_expect_failure 'push --atomic also prevents branch creation, reports collateral' '
# Setup upstream repo - empty for now
d=$HTTPD_DOCUMENT_ROOT_PATH/atomic-branches.git &&
git init --bare "$d" &&
@@ -200,7 +200,7 @@ test_expect_success 'atomic push is not advertised if configured' '
# References in upstream : master(1) one(1) foo(1)
# References in workbench: master(2) foo(1) two(2) bar(2)
# Atomic push : master(2) two(2) bar(2)
-test_expect_failure 'atomic push reports (reject by update hook)' '
+test_expect_success 'atomic push reports (reject by update hook)' '
mk_repo_pair &&
(
cd workbench &&
@@ -241,7 +241,7 @@ test_expect_failure 'atomic push reports (reject by update hook)' '
# References in upstream : master(1) one(1) foo(1)
# References in workbench: master(2) foo(1) two(2) bar(2)
-test_expect_failure 'atomic push reports (mirror, but reject by update hook)' '
+test_expect_success 'atomic push reports (mirror, but reject by update hook)' '
(
cd workbench &&
git remote remove up &&
@@ -262,7 +262,7 @@ test_expect_failure 'atomic push reports (mirror, but reject by update hook)' '
# References in upstream : master(2) one(1) foo(1)
# References in workbench: master(1) foo(1) two(2) bar(2)
-test_expect_failure 'atomic push reports (reject by non-ff)' '
+test_expect_success 'atomic push reports (reject by non-ff)' '
rm upstream/.git/hooks/update &&
(
cd workbench &&
@@ -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_success "atomic push failed ($PROTOCOL)" '
+ test_expect_failure "atomic push failed ($PROTOCOL)" '
(
cd workbench &&
git update-ref refs/heads/master $B &&
@@ -1248,20 +1248,6 @@ int transport_push(struct repository *r,
err = push_had_errors(remote_refs);
ret = push_ret | err;
- if ((flags & TRANSPORT_PUSH_ATOMIC) && err) {
- struct ref *it;
- for (it = remote_refs; it; it = it->next)
- switch (it->status) {
- case REF_STATUS_NONE:
- case REF_STATUS_UPTODATE:
- case REF_STATUS_OK:
- it->status = REF_STATUS_ATOMIC_PUSH_FAILED;
- break;
- default:
- break;
- }
- }
-
if (!quiet || err)
transport_print_push_status(transport->url, remote_refs,
verbose | porcelain, porcelain,