diff options
| author | Johannes Schindelin <johannes.schindelin@gmx.de> | 2018-10-30 11:44:40 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2018-10-31 12:48:59 +0900 |
| commit | ff8978d533207f472b183223d88786b1053f1989 (patch) | |
| tree | e50956d18ebd8814d9d29d274bf89cc41af25b4d /builtin/commit.c | |
| parent | Seventh batch for 2.20 (diff) | |
| download | git-ff8978d533207f472b183223d88786b1053f1989.tar.gz git-ff8978d533207f472b183223d88786b1053f1989.zip | |
mingw: fix isatty() after dup2()
Since a9b8a09c3c30 (mingw: replace isatty() hack, 2016-12-22), we handle
isatty() by special-casing the stdin/stdout/stderr file descriptors,
caching the return value. However, we missed the case where dup2()
overrides the respective file descriptor.
That poses a problem e.g. where the `show` builtin asks for a pager very
early, the `setup_pager()` function sets the pager depending on the
return value of `isatty()` and then redirects stdout. Subsequently,
`cmd_log_init_finish()` calls `setup_pager()` *again*. What should
happen now is that `isatty()` reports that stdout is *not* a TTY and
consequently stdout should be left alone.
Let's override dup2() to handle this appropriately.
This fixes https://github.com/git-for-windows/git/issues/1077
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/commit.c')
0 files changed, 0 insertions, 0 deletions
