]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'maint'
authorJunio C Hamano <gitster@pobox.com>
Wed, 4 Jan 2012 19:21:42 +0000 (11:21 -0800)
committerJunio C Hamano <gitster@pobox.com>
Wed, 4 Jan 2012 19:21:42 +0000 (11:21 -0800)
* maint:
  t5550: repack everything into one file
  Catch invalid --depth option passed to clone or fetch

t/t5550-http-fetch.sh
transport.c

index 95a133d697204a3b5dc469d188939198727e183a..e5e6b8f643206c2d4fd01e3ad71ca50a43f3da19 100755 (executable)
@@ -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
 '
index a99b7c9c457c4ac3b76dc6859507711f847e5f62..cac0c065ff9f82011b204f932932283b01a5d034 100644 (file)
@@ -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;