summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2015-05-22 19:41:58 (GMT)
committerJunio C Hamano <gitster@pobox.com>2015-05-22 19:41:58 (GMT)
commit17e785f6bacee806767aee0ba48d8c76a99a9895 (patch)
treeb8ba82b9543de0c5e2757fd63c0aebc2c73cbd34
parentddaf4e2e9a8b38185405205ddead638cf052728e (diff)
parenta4fb76ce1916939c7e6359f9416f2af4a760f6f1 (diff)
downloadgit-17e785f6bacee806767aee0ba48d8c76a99a9895.zip
git-17e785f6bacee806767aee0ba48d8c76a99a9895.tar.gz
git-17e785f6bacee806767aee0ba48d8c76a99a9895.tar.bz2
Merge branch 'lm/squelch-bg-progress'
The controlling tty-based heuristics to squelch progress output did not consider that the process may not be talking to a tty at all (e.g. sending the progress to sideband #2). This is a finishing touch to a topic that is already in 'master'. * lm/squelch-bg-progress: progress: treat "no terminal" as being in the foreground
-rw-r--r--progress.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/progress.c b/progress.c
index 43d9228..2e31bec 100644
--- a/progress.c
+++ b/progress.c
@@ -74,7 +74,8 @@ static void clear_progress_signal(void)
static int is_foreground_fd(int fd)
{
- return getpgid(0) == tcgetpgrp(fd);
+ int tpgrp = tcgetpgrp(fd);
+ return tpgrp < 0 || tpgrp == getpgid(0);
}
static int display(struct progress *progress, unsigned n, const char *done)