summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrés G. Aragoneses <knocte@gmail.com>2013-11-21 16:27:28 +0100
committerJunio C Hamano <gitster@pobox.com>2013-11-21 09:33:25 -0800
commit983032d54966aa1aad38f643c850b752ada63a39 (patch)
tree18804d9a4f2d972112993cd99f37590558fb5d37
parentbecb4336cb05c5ec456babaeafefa2e24ee85773 (diff)
downloadgit-aa/transport-no-non-positive-depth.tar.gz
transport: disallow non positive --depth option valueaa/transport-no-non-positive-depth
Instead of simply ignoring the value passed to --depth option when it is zero or negative, now it is caught and reported. This will let people know that they were using the option incorrectly, because under the hood depth==0 didn't have any effect. Signed-off-by: Andres G. Aragoneses <knocte@gmail.com> Reviewed-by: Duy Nguyen <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--transport.c2
1 files changed, 2 insertions, 0 deletions
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;
}