t7006: add tests for how git tag paginates
[gitweb.git] / git.c
diff --git a/git.c b/git.c
index 79195ebbdfc1a1964d155f28951ee9ffbe279887..66832f2324f6f9ad4d6b697f95d0d36eaecb62c1 100644 (file)
--- a/git.c
+++ b/git.c
@@ -33,6 +33,16 @@ static void commit_pager_choice(void) {
        }
 }
 
+void setup_auto_pager(const char *cmd, int def)
+{
+       if (use_pager != -1 || pager_in_use())
+               return;
+       use_pager = check_pager_config(cmd);
+       if (use_pager == -1)
+               use_pager = def;
+       commit_pager_choice();
+}
+
 static int handle_options(const char ***argv, int *argc, int *envchanged)
 {
        const char **orig_argv = *argv;