Skip to content

Commit

Permalink
Merge branch 'nd/maint-parse-depth' into maint
Browse files Browse the repository at this point in the history
* nd/maint-parse-depth:
  Catch invalid --depth option passed to clone or fetch
  • Loading branch information
gitster committed Jan 4, 2012
2 parents bc0fe84 + e7622ce commit 6ea9385
Showing 1 changed file with 6 additions and 2 deletions.
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 6ea9385

Please sign in to comment.