aboutsummaryrefslogtreecommitdiff
path: root/remote-curl.c
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2016-06-12 17:54:04 +0700
committerJunio C Hamano <gitster@pobox.com>2016-06-13 14:38:16 -0700
commita45a260086b395729e3c26c9680602e1352184b5 (patch)
tree4fab7f0bedb5b0c16ded43c7a12465159e941240 /remote-curl.c
parent269a7a831636b7c7a453f6621fc8b440ff28a408 (diff)
downloadgit-a45a260086b395729e3c26c9680602e1352184b5.tar.gz
git-a45a260086b395729e3c26c9680602e1352184b5.tar.xz
fetch: define shallow boundary with --shallow-exclude
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'remote-curl.c')
-rw-r--r--remote-curl.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/remote-curl.c b/remote-curl.c
index 5876f2402..1406e6a4e 100644
--- a/remote-curl.c
+++ b/remote-curl.c
@@ -21,6 +21,7 @@ struct options {
int verbosity;
unsigned long depth;
char *deepen_since;
+ struct string_list deepen_not;
unsigned progress : 1,
check_self_contained_and_connected : 1,
cloning : 1,
@@ -65,6 +66,10 @@ static int set_option(const char *name, const char *value)
options.deepen_since = xstrdup(value);
return 0;
}
+ else if (!strcmp(name, "deepen-not")) {
+ string_list_append(&options.deepen_not, value);
+ return 0;
+ }
else if (!strcmp(name, "followtags")) {
if (!strcmp(value, "true"))
options.followtags = 1;
@@ -753,6 +758,9 @@ static int fetch_git(struct discovery *heads,
argv_array_pushf(&args, "--depth=%lu", options.depth);
if (options.deepen_since)
argv_array_pushf(&args, "--shallow-since=%s", options.deepen_since);
+ for (i = 0; i < options.deepen_not.nr; i++)
+ argv_array_pushf(&args, "--shallow-exclude=%s",
+ options.deepen_not.items[i].string);
argv_array_push(&args, url.buf);
for (i = 0; i < nr_heads; i++) {
@@ -973,6 +981,7 @@ int main(int argc, const char **argv)
options.verbosity = 1;
options.progress = !!isatty(2);
options.thin = 1;
+ string_list_init(&options.deepen_not, 1);
remote = remote_get(argv[1]);