From: Thomas Rast Date: Tue, 6 Jan 2009 23:56:03 +0000 (+0100) Subject: diff --no-index: test for pager after option parsing X-Git-Tag: v1.6.1.1~2^2~1 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=c6dbca08ca39d9cd511a36cdd18847b8720f1653;p=git.git diff --no-index: test for pager after option parsing We need to parse options before we can see if --exit-code was provided. Signed-off-by: Thomas Rast Signed-off-by: Junio C Hamano --- diff --git a/diff-no-index.c b/diff-no-index.c index 39868e2a8..12ff1f1ee 100644 --- a/diff-no-index.c +++ b/diff-no-index.c @@ -200,13 +200,6 @@ void diff_no_index(struct rev_info *revs, die("git diff %s takes two paths", no_index ? "--no-index" : "[--no-index]"); - /* - * If the user asked for our exit code then don't start a - * pager or we would end up reporting its exit code instead. - */ - if (!DIFF_OPT_TST(&revs->diffopt, EXIT_WITH_STATUS)) - setup_pager(); - diff_setup(&revs->diffopt); if (!revs->diffopt.output_format) revs->diffopt.output_format = DIFF_FORMAT_PATCH; @@ -226,6 +219,13 @@ void diff_no_index(struct rev_info *revs, } } + /* + * If the user asked for our exit code then don't start a + * pager or we would end up reporting its exit code instead. + */ + if (!DIFF_OPT_TST(&revs->diffopt, EXIT_WITH_STATUS)) + setup_pager(); + if (prefix) { int len = strlen(prefix);