From d01b3c02e8a066054c308ee2ce521a2ea44738d3 Mon Sep 17 00:00:00 2001 From: Tay Ray Chuan Date: Wed, 24 Feb 2010 20:50:26 +0800 Subject: transport->progress: use flag authoritatively Set transport->progress in transport.c::transport_set_verbosity() after checking for the appropriate conditions (eg. --progress, isatty(2)), and thereafter use it without having to check again. The rules used are as follows (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. This changes progress reporting behaviour such that if both --progress and --quiet are specified, progress is reported. In two areas, the logic to determine whether to *not* show progress is changed to simply use the negation of transport->progress. This changes behaviour in some ways (see previous paragraph for details). Signed-off-by: Tay Ray Chuan Signed-off-by: Junio C Hamano --- transport-helper.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'transport-helper.c') diff --git a/transport-helper.c b/transport-helper.c index 3d33697a4b..3e69ebd188 100644 --- a/transport-helper.c +++ b/transport-helper.c @@ -279,9 +279,8 @@ static void standard_options(struct transport *t) char buf[16]; int n; int v = t->verbose; - int no_progress = v < 0 || (!t->progress && !isatty(2)); - set_helper_option(t, "progress", !no_progress ? "true" : "false"); + set_helper_option(t, "progress", t->progress ? "true" : "false"); n = snprintf(buf, sizeof(buf), "%d", v + 1); if (n >= sizeof(buf)) -- cgit v1.2.1