X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=transport.c;h=401b8dd35ce9acd88f38440fc52b908898119a81;hb=b2c8c6d944722f9a4f27370f4e89d13f61243302;hp=a99b7c9c457c4ac3b76dc6859507711f847e5f62;hpb=2b380d81917cb4205a0c13224086fdd9268d5b71;p=git.git diff --git a/transport.c b/transport.c index a99b7c9c4..401b8dd35 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; @@ -989,11 +993,15 @@ void transport_set_verbosity(struct transport *transport, int verbosity, * Rules used to determine whether to report progress (processing aborts * when a rule is satisfied): * - * 1. Report progress, if force_progress is 1 (ie. --progress). - * 2. Don't report progress, if verbosity < 0 (ie. -q/--quiet ). - * 3. Report progress if isatty(2) is 1. + * . Report progress, if force_progress is 1 (ie. --progress). + * . Don't report progress, if force_progress is 0 (ie. --no-progress). + * . Don't report progress, if verbosity < 0 (ie. -q/--quiet ). + * . Report progress if isatty(2) is 1. **/ - transport->progress = force_progress || (verbosity >= 0 && isatty(2)); + if (force_progress >= 0) + transport->progress = !!force_progress; + else + transport->progress = verbosity >= 0 && isatty(2); } int transport_push(struct transport *transport,