aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Rast <trast@student.ethz.ch>2009-01-07 00:56:03 +0100
committerJunio C Hamano <gitster@pobox.com>2009-01-06 23:40:02 -0800
commitc6dbca08ca39d9cd511a36cdd18847b8720f1653 (patch)
treeb5112ed9ee74847bac9026cdfaccb0bcc207ad2a
parente423ffd8a6f46a14ecbb637d909290bd3579cebd (diff)
downloadgit-c6dbca08ca39d9cd511a36cdd18847b8720f1653.tar.gz
git-c6dbca08ca39d9cd511a36cdd18847b8720f1653.tar.xz
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 <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--diff-no-index.c14
1 files changed, 7 insertions, 7 deletions
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);