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:
authorJunio C Hamano <gitster@pobox.com>2021-08-25 01:32:40 +0300
committerJunio C Hamano <gitster@pobox.com>2021-08-25 01:32:40 +0300
commit066f6cd44707ca2f8c3dc2a2ae02c2c9784903bf (patch)
treec999b2444dfcb545f683ce39e6d8d70beae882ea /send-pack.c
parent6f64eeab605b82b187b2dd1fc72492f434bad603 (diff)
parent82823118b9cd397d6b626cc86a0e555069ea8253 (diff)
Merge branch 'jt/push-negotiation-fixes'
Bugfix for common ancestor negotiation recently introduced in "git push" code path. * jt/push-negotiation-fixes: fetch: die on invalid --negotiation-tip hash send-pack: fix push nego. when remote has refs send-pack: fix push.negotiate with remote helper
Diffstat (limited to 'send-pack.c')
-rw-r--r--send-pack.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/send-pack.c b/send-pack.c
index 5a79e0e711..b3a495b7b1 100644
--- a/send-pack.c
+++ b/send-pack.c
@@ -425,8 +425,10 @@ static void get_commons_through_negotiation(const char *url,
child.no_stdin = 1;
child.out = -1;
strvec_pushl(&child.args, "fetch", "--negotiate-only", NULL);
- for (ref = remote_refs; ref; ref = ref->next)
- strvec_pushf(&child.args, "--negotiation-tip=%s", oid_to_hex(&ref->new_oid));
+ for (ref = remote_refs; ref; ref = ref->next) {
+ if (!is_null_oid(&ref->new_oid))
+ strvec_pushf(&child.args, "--negotiation-tip=%s", oid_to_hex(&ref->new_oid));
+ }
strvec_push(&child.args, url);
if (start_command(&child))