Skip to content

Commit

Permalink
Merge branch 'maint'
Browse files Browse the repository at this point in the history
* maint:
  t5550: repack everything into one file
  Catch invalid --depth option passed to clone or fetch
  • Loading branch information
Junio C Hamano committed Jan 4, 2012
2 parents 4570aeb + 1327d83 commit 247f9d2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
3 changes: 1 addition & 2 deletions t/t5550-http-fetch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
'
Expand Down
8 changes: 6 additions & 2 deletions transport.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 247f9d2

Please sign in to comment.