Skip to content

Commit

Permalink
Merge branch 'lm/squelch-bg-progress'
Browse files Browse the repository at this point in the history
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
  • Loading branch information
gitster committed May 22, 2015
2 parents ddaf4e2 + a4fb76c commit 17e785f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion progress.c
Expand Up @@ -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)
Expand Down

0 comments on commit 17e785f

Please sign in to comment.