diff options
author | Junio C Hamano <gitster@pobox.com> | 2021-08-25 01:32:40 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-08-25 01:32:40 +0300 |
commit | 066f6cd44707ca2f8c3dc2a2ae02c2c9784903bf (patch) | |
tree | c999b2444dfcb545f683ce39e6d8d70beae882ea /send-pack.c | |
parent | 6f64eeab605b82b187b2dd1fc72492f434bad603 (diff) | |
parent | 82823118b9cd397d6b626cc86a0e555069ea8253 (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.c | 6 |
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)) |