[PATCH 07/43] builtin: USE_PAGER should not be used without RUN_SETUP*
- From
Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
- Date
- Apr 5, 2010, 18:40 UTC
- Message-ID
- <1270492888-26589-8-git-send-email-pclouds@gmail.com>
- In-Reply-To
- <1270492888-26589-1-git-send-email-pclouds@gmail.com>
USE_PAGER may need core.pager from repository. So a repository search should be done before core.pager is read.
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com> --- git.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/git.c b/git.c index 3904fe2..84dd78e 100644 --- a/git.c +++ b/git.c @@ -253,8 +253,11 @@ static int run_builtin(struct cmd_struct *p, int argc, const char **argv) if (use_pager == -1 && p->option & RUN_SETUP) use_pager = check_pager_config(p->cmd); - if (use_pager == -1 && p->option & USE_PAGER) + if (use_pager == -1 && p->option & USE_PAGER) { + if ((p->option & (RUN_SETUP | RUN_SETUP_GENTLY)) == 0) + die("Internal error: USE_PAGER must be together with RUN_SETUP*"); use_pager = 1; + } } commit_pager_choice();
-- 1.7.0.rc1.541.g2da82.dirty