Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiang Xin <zhiyou.jx@alibaba-inc.com>2020-04-17 12:45:34 +0300
committerJunio C Hamano <gitster@pobox.com>2020-04-17 22:16:31 +0300
commit46701bde690f94fb1532bce110eae93d5f6b68a1 (patch)
tree357f9065d32175866b7294324e6c0bee9ed0ce26 /send-pack.c
parent865e23f532fc78d207cf81587deee9f861c7a5aa (diff)
send-pack: mark failure of atomic push properly
When pushing with SSH or other smart protocol, references are validated by function `check_to_send_update()` before they are sent in commands to `send_pack()` of "receve-pack". For atomic push, if a reference is rejected after the validation, only references pushed by user should be marked as failure, instead of report failure on all remote references. Commit v2.22.0-1-g3bca1e7f9f (transport-helper: enforce atomic in push_refs_with_push, 2019-07-11) wanted to fix report issue of HTTP protocol, but marked all remote references failure for atomic push. In order to fix the issue of status report for SSH or other built-in smart protocol, revert part of that commit and add additional status for function `atomic_push_failure()`. The additional status for it except the "REF_STATUS_EXPECTING_REPORT" status are: - REF_STATUS_NONE : Not marked as "REF_STATUS_EXPECTING_REPORT" yet. - REF_STATUS_OK : Assume OK for dryrun or status_report is disabled. This fix won't resolve the issue of status report in transport-helper for HTTP or other protocols, and breaks test case in t5541. Will fix it in additional commit. Signed-off-by: Jiang Xin <zhiyou.jx@alibaba-inc.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'send-pack.c')
-rw-r--r--send-pack.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/send-pack.c b/send-pack.c
index 1835cd5582..efefb687b2 100644
--- a/send-pack.c
+++ b/send-pack.c
@@ -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;