| 7864 | } |
| 7865 | |
| 7866 | void 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 | } |
no test coverage detected