summaryrefslogtreecommitdiff
path: root/transport-helper.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 /transport-helper.c
parent269a7a831636b7c7a453f6621fc8b440ff28a408 (diff)
downloadgit-a45a260086b395729e3c26c9680602e1352184b5.tar.gz
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 'transport-helper.c')
-rw-r--r--transport-helper.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/transport-helper.c b/transport-helper.c
index 27a34e9d4e..cc1a396c25 100644
--- a/transport-helper.c
+++ b/transport-helper.c
@@ -282,6 +282,26 @@ static int strbuf_set_helper_option(struct helper_data *data,
return ret;
}
+static int string_list_set_helper_option(struct helper_data *data,
+ const char *name,
+ struct string_list *list)
+{
+ struct strbuf buf = STRBUF_INIT;
+ int i, ret = 0;
+
+ for (i = 0; i < list->nr; i++) {
+ strbuf_addf(&buf, "option %s ", name);
+ quote_c_style(list->items[i].string, &buf, NULL, 0);
+ strbuf_addch(&buf, '\n');
+
+ if ((ret = strbuf_set_helper_option(data, &buf)))
+ break;
+ strbuf_reset(&buf);
+ }
+ strbuf_release(&buf);
+ return ret;
+}
+
static int set_helper_option(struct transport *transport,
const char *name, const char *value)
{
@@ -294,6 +314,10 @@ static int set_helper_option(struct transport *transport,
if (!data->option)
return 1;
+ if (!strcmp(name, "deepen-not"))
+ return string_list_set_helper_option(data, name,
+ (struct string_list *)value);
+
for (i = 0; i < ARRAY_SIZE(unsupported_options); i++) {
if (!strcmp(name, unsupported_options[i]))
return 1;