git diff --no-index: default to page like other diff frontends
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano committed
May 26, 2008 at 22:35 UTC
b3fde6ccb1cbdd362dec19e317905f71528b3a53
1 file changed
+7
diff-no-index.c
+7
@@ -198,6 +198,13 @@ void diff_no_index(struct rev_info *revs,
198
die("git diff %s takes two paths",
199
no_index ? "--no-index" : "[--no-index]");
200
201
+ /*
202
+ * If the user asked for our exit code then don't start a
203
+ * pager or we would end up reporting its exit code instead.
204
+ */
205
+ if (!DIFF_OPT_TST(&revs->diffopt, EXIT_WITH_STATUS))
206
+ setup_pager();
207
+
208
diff_setup(&revs->diffopt);
209
if (!revs->diffopt.output_format)
210
revs->diffopt.output_format = DIFF_FORMAT_PATCH;