summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config.c3
-rw-r--r--pager.c9
2 files changed, 8 insertions, 4 deletions
diff --git a/config.c b/config.c
index 6dbc8a409e..1d2331aa08 100644
--- a/config.c
+++ b/config.c
@@ -836,9 +836,6 @@ static int git_default_core_config(const char *var, const char *value)
return 0;
}
- if (!strcmp(var, "core.pager"))
- return git_config_string(&pager_program, var, value);
-
if (!strcmp(var, "core.editor"))
return git_config_string(&editor_program, var, value);
diff --git a/pager.c b/pager.c
index 70159b8858..fc210f951d 100644
--- a/pager.c
+++ b/pager.c
@@ -35,6 +35,13 @@ static void wait_for_pager_signal(int signo)
raise(signo);
}
+static int core_pager_config(const char *var, const char *value, void *data)
+{
+ if (!strcmp(var, "core.pager"))
+ return git_config_string(&pager_program, var, value);
+ return 0;
+}
+
const char *git_pager(int stdout_is_tty)
{
const char *pager;
@@ -45,7 +52,7 @@ const char *git_pager(int stdout_is_tty)
pager = getenv("GIT_PAGER");
if (!pager) {
if (!pager_program)
- git_config(git_default_config, NULL);
+ git_config(core_pager_config, NULL);
pager = pager_program;
}
if (!pager)