summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--builtin-var.c2
-rw-r--r--cache.h2
-rw-r--r--pager.c6
3 files changed, 5 insertions, 5 deletions
diff --git a/builtin-var.c b/builtin-var.c
index e6ee7bc0b6..70fdb4dec7 100644
--- a/builtin-var.c
+++ b/builtin-var.c
@@ -20,7 +20,7 @@ static const char *editor(int flag)
static const char *pager(int flag)
{
- const char *pgm = git_pager();
+ const char *pgm = git_pager(1);
if (!pgm)
pgm = "cat";
diff --git a/cache.h b/cache.h
index d478eff1f3..d454b7e686 100644
--- a/cache.h
+++ b/cache.h
@@ -775,7 +775,7 @@ extern const char *git_committer_info(int);
extern const char *fmt_ident(const char *name, const char *email, const char *date_str, int);
extern const char *fmt_name(const char *name, const char *email);
extern const char *git_editor(void);
-extern const char *git_pager(void);
+extern const char *git_pager(int stdout_is_tty);
struct checkout {
const char *base_dir;
diff --git a/pager.c b/pager.c
index 2c7e8ecb3c..dac358f047 100644
--- a/pager.c
+++ b/pager.c
@@ -48,11 +48,11 @@ static void wait_for_pager_signal(int signo)
raise(signo);
}
-const char *git_pager(void)
+const char *git_pager(int stdout_is_tty)
{
const char *pager;
- if (!isatty(1))
+ if (!stdout_is_tty)
return NULL;
pager = getenv("GIT_PAGER");
@@ -73,7 +73,7 @@ const char *git_pager(void)
void setup_pager(void)
{
- const char *pager = git_pager();
+ const char *pager = git_pager(isatty(1));
if (!pager)
return;