diff options
author | Junio C Hamano <gitster@pobox.com> | 2013-09-09 14:30:01 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-09-09 14:30:01 -0700 |
commit | 711b2769740637e228c8200927e96b31f2065d32 (patch) | |
tree | 423a57f9f9edc28bbca1c9d607cae0fa72782884 /transport-helper.c | |
parent | 01a2a03c56e8d4cd9724b185a48a2a1ea9852f0c (diff) | |
parent | 9ba380481cc3a5ae7706763d71cf8844917ed804 (diff) | |
download | git-711b2769740637e228c8200927e96b31f2065d32.tar.gz |
Merge branch 'nd/clone-connectivity-shortcut'
* nd/clone-connectivity-shortcut:
smart http: use the same connectivity check on cloning
Diffstat (limited to 'transport-helper.c')
-rw-r--r-- | transport-helper.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/transport-helper.c b/transport-helper.c index 63cabc37e3..bec3b721fa 100644 --- a/transport-helper.c +++ b/transport-helper.c @@ -27,6 +27,7 @@ struct helper_data { push : 1, connect : 1, signed_tags : 1, + check_connectivity : 1, no_disconnect_req : 1; char *export_marks; char *import_marks; @@ -186,6 +187,8 @@ static struct child_process *get_helper(struct transport *transport) data->bidi_import = 1; else if (!strcmp(capname, "export")) data->export = 1; + else if (!strcmp(capname, "check-connectivity")) + data->check_connectivity = 1; else if (!data->refspecs && !prefixcmp(capname, "refspec ")) { ALLOC_GROW(refspecs, refspec_nr + 1, @@ -349,6 +352,9 @@ static int fetch_with_fetch(struct transport *transport, struct strbuf buf = STRBUF_INIT; standard_options(transport); + if (data->check_connectivity && + data->transport_options.check_self_contained_and_connected) + set_helper_option(transport, "check-connectivity", "true"); for (i = 0; i < nr_heads; i++) { const struct ref *posn = to_fetch[i]; @@ -372,6 +378,10 @@ static int fetch_with_fetch(struct transport *transport, else transport->pack_lockfile = xstrdup(name); } + else if (data->check_connectivity && + data->transport_options.check_self_contained_and_connected && + !strcmp(buf.buf, "connectivity-ok")) + data->transport_options.self_contained_and_connected = 1; else if (!buf.len) break; else |