Files
git/compat
Johannes Schindelin e7e9e5c7e2 mingw: fix isatty() after dup2()
We newly 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>
2018-10-12 22:41:18 +02:00
..
2017-07-05 14:01:03 -07:00
2017-07-05 14:01:03 -07:00
2018-08-13 15:22:19 -07:00
2018-10-12 22:41:18 +02:00
2017-01-23 11:02:34 -08:00
2018-10-12 22:41:18 +02:00