summaryrefslogtreecommitdiff
path: root/remote-curl.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2013-09-09 14:30:01 -0700
committerJunio C Hamano <gitster@pobox.com>2013-09-09 14:30:01 -0700
commit711b2769740637e228c8200927e96b31f2065d32 (patch)
tree423a57f9f9edc28bbca1c9d607cae0fa72782884 /remote-curl.c
parent01a2a03c56e8d4cd9724b185a48a2a1ea9852f0c (diff)
parent9ba380481cc3a5ae7706763d71cf8844917ed804 (diff)
downloadgit-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 'remote-curl.c')
-rw-r--r--remote-curl.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/remote-curl.c b/remote-curl.c
index 5b3ce9eed2..6918668dc2 100644
--- a/remote-curl.c
+++ b/remote-curl.c
@@ -16,6 +16,7 @@ struct options {
int verbosity;
unsigned long depth;
unsigned progress : 1,
+ check_self_contained_and_connected : 1,
followtags : 1,
dry_run : 1,
thin : 1;
@@ -67,6 +68,15 @@ static int set_option(const char *name, const char *value)
return -1;
return 0;
}
+ else if (!strcmp(name, "check-connectivity")) {
+ if (!strcmp(value, "true"))
+ options.check_self_contained_and_connected = 1;
+ else if (!strcmp(value, "false"))
+ options.check_self_contained_and_connected = 0;
+ else
+ return -1;
+ return 0;
+ }
else {
return 1 /* unsupported */;
}
@@ -654,7 +664,7 @@ static int fetch_git(struct discovery *heads,
struct strbuf preamble = STRBUF_INIT;
char *depth_arg = NULL;
int argc = 0, i, err;
- const char *argv[15];
+ const char *argv[16];
argv[argc++] = "fetch-pack";
argv[argc++] = "--stateless-rpc";
@@ -668,6 +678,8 @@ static int fetch_git(struct discovery *heads,
argv[argc++] = "-v";
argv[argc++] = "-v";
}
+ if (options.check_self_contained_and_connected)
+ argv[argc++] = "--check-self-contained-and-connected";
if (!options.progress)
argv[argc++] = "--no-progress";
if (options.depth) {
@@ -939,6 +951,7 @@ int main(int argc, const char **argv)
printf("fetch\n");
printf("option\n");
printf("push\n");
+ printf("check-connectivity\n");
printf("\n");
fflush(stdout);
} else {