diff options
author | Junio C Hamano <gitster@pobox.com> | 2012-01-04 11:21:42 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2012-01-04 11:21:42 -0800 |
commit | 247f9d23da8cfd255533433ad2aa07d172afac0b (patch) | |
tree | b004483b600ed0a4b0e69396544bbe28081ee1ba | |
parent | Merge branch 'pw/p4-docs-and-tests' (diff) | |
parent | t5550: repack everything into one file (diff) | |
download | tgif-247f9d23da8cfd255533433ad2aa07d172afac0b.tar.xz |
Merge branch 'maint'
* maint:
t5550: repack everything into one file
Catch invalid --depth option passed to clone or fetch
-rwxr-xr-x | t/t5550-http-fetch.sh | 3 | ||||
-rw-r--r-- | transport.c | 8 |
2 files changed, 7 insertions, 4 deletions
diff --git a/t/t5550-http-fetch.sh b/t/t5550-http-fetch.sh index 95a133d697..e5e6b8f643 100755 --- a/t/t5550-http-fetch.sh +++ b/t/t5550-http-fetch.sh @@ -162,8 +162,7 @@ test_expect_success 'http remote detects correct HEAD' ' test_expect_success 'fetch packed objects' ' cp -R "$HTTPD_DOCUMENT_ROOT_PATH"/repo.git "$HTTPD_DOCUMENT_ROOT_PATH"/repo_pack.git && (cd "$HTTPD_DOCUMENT_ROOT_PATH"/repo_pack.git && - git --bare repack && - git --bare prune-packed + git --bare repack -a -d ) && git clone $HTTPD_URL/dumb/repo_pack.git ' diff --git a/transport.c b/transport.c index a99b7c9c45..cac0c065ff 100644 --- a/transport.c +++ b/transport.c @@ -474,8 +474,12 @@ static int set_git_option(struct git_transport_options *opts, } else if (!strcmp(name, TRANS_OPT_DEPTH)) { if (!value) opts->depth = 0; - else - opts->depth = atoi(value); + else { + char *end; + opts->depth = strtol(value, &end, 0); + if (*end) + die("transport: invalid depth option '%s'", value); + } return 0; } return 1; |