Skip to content

Commit 247f9d2

Browse files
committed
Merge branch 'maint'
* maint: t5550: repack everything into one file Catch invalid --depth option passed to clone or fetch
2 parents 4570aeb + 1327d83 commit 247f9d2

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

t/t5550-http-fetch.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,7 @@ test_expect_success 'http remote detects correct HEAD' '
162162
test_expect_success 'fetch packed objects' '
163163
cp -R "$HTTPD_DOCUMENT_ROOT_PATH"/repo.git "$HTTPD_DOCUMENT_ROOT_PATH"/repo_pack.git &&
164164
(cd "$HTTPD_DOCUMENT_ROOT_PATH"/repo_pack.git &&
165-
git --bare repack &&
166-
git --bare prune-packed
165+
git --bare repack -a -d
167166
) &&
168167
git clone $HTTPD_URL/dumb/repo_pack.git
169168
'

transport.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -474,8 +474,12 @@ static int set_git_option(struct git_transport_options *opts,
474474
} else if (!strcmp(name, TRANS_OPT_DEPTH)) {
475475
if (!value)
476476
opts->depth = 0;
477-
else
478-
opts->depth = atoi(value);
477+
else {
478+
char *end;
479+
opts->depth = strtol(value, &end, 0);
480+
if (*end)
481+
die("transport: invalid depth option '%s'", value);
482+
}
479483
return 0;
480484
}
481485
return 1;

0 commit comments

Comments
 (0)