summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--builtin/fetch.c2
-rw-r--r--transport.c2
2 files changed, 3 insertions, 1 deletions
diff --git a/builtin/fetch.c b/builtin/fetch.c
index 564705555b..743e74abd4 100644
--- a/builtin/fetch.c
+++ b/builtin/fetch.c
@@ -756,7 +756,7 @@ static void backfill_tags(struct transport *transport, struct ref *ref_map)
}
transport_set_option(transport, TRANS_OPT_FOLLOWTAGS, NULL);
- transport_set_option(transport, TRANS_OPT_DEPTH, "0");
+ transport_set_option(transport, TRANS_OPT_DEPTH, NULL);
fetch_refs(transport, ref_map);
if (gsecondary) {
diff --git a/transport.c b/transport.c
index de255880a4..2250612945 100644
--- a/transport.c
+++ b/transport.c
@@ -481,6 +481,8 @@ static int set_git_option(struct git_transport_options *opts,
opts->depth = strtol(value, &end, 0);
if (*end)
die("transport: invalid depth option '%s'", value);
+ if (opts->depth < 1)
+ die("transport: invalid depth option '%s' (must be positive)", value);
}
return 0;
}