Code

builtin-commit.c: do not remove COMMIT_EDITMSG
[git.git] / pager.c
diff --git a/pager.c b/pager.c
index 6b5c9e44b4ded338ddb344ae454d83a685b7569a..0b7e55f476ac17609d88821e78bd89a511f4b3aa 100644 (file)
--- a/pager.c
+++ b/pager.c
@@ -102,7 +102,8 @@ void setup_pager(void)
 
        /* original process continues, but writes to the pipe */
        dup2(pager_process.in, 1);
-       dup2(pager_process.in, 2);
+       if (isatty(2))
+               dup2(pager_process.in, 2);
        close(pager_process.in);
 
        /* this makes sure that the parent terminates after the pager */