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

Function setup_diff_pager

diff.c:7866–7880  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7864}
7865
7866void setup_diff_pager(struct diff_options *opt)
7867{
7868 /*
7869 * If the user asked for our exit code, then either they want --quiet
7870 * or --exit-code. We should definitely not bother with a pager in the
7871 * former case, as we will generate no output. Since we still properly
7872 * report our exit code even when a pager is run, we _could_ run a
7873 * pager with --exit-code. But since we have not done so historically,
7874 * and because it is easy to find people oneline advising "git diff
7875 * --exit-code" in hooks and other scripts, we do not do so.
7876 */
7877 if (!opt->flags.exit_with_status &&
7878 check_pager_config(the_repository, "diff") != 0)
7879 setup_pager(the_repository);
7880}

Callers 3

diff_no_indexFunction · 0.85
show_stashFunction · 0.85
cmd_diffFunction · 0.85

Calls 2

check_pager_configFunction · 0.85
setup_pagerFunction · 0.85

Tested by

no test coverage detected