MCPcopy Create free account
hub / github.com/git/git / git_pager

Function git_pager

pager.c:85–107  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

83}
84
85const char *git_pager(struct repository *r, int stdout_is_tty)
86{
87 const char *pager;
88
89 if (!stdout_is_tty)
90 return NULL;
91
92 pager = getenv("GIT_PAGER");
93 if (!pager) {
94 if (!pager_program)
95 read_early_config(r,
96 core_pager_config, NULL);
97 pager = pager_program;
98 }
99 if (!pager)
100 pager = getenv("PAGER");
101 if (!pager)
102 pager = DEFAULT_PAGER;
103 if (!*pager || !strcmp(pager, "cat"))
104 pager = NULL;
105
106 return pager;
107}
108
109static void setup_pager_env(struct strvec *env)
110{

Callers 4

setup_pagerFunction · 0.85
do_interactiveFunction · 0.85
cmd_grepFunction · 0.85
pagerFunction · 0.85

Calls 1

read_early_configFunction · 0.85

Tested by

no test coverage detected