Skip to content

Commit b3fde6c

Browse files
committed
git diff --no-index: default to page like other diff frontends
Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 0403660 commit b3fde6c

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

diff-no-index.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,13 @@ void diff_no_index(struct rev_info *revs,
198198
die("git diff %s takes two paths",
199199
no_index ? "--no-index" : "[--no-index]");
200200

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+
201208
diff_setup(&revs->diffopt);
202209
if (!revs->diffopt.output_format)
203210
revs->diffopt.output_format = DIFF_FORMAT_PATCH;

0 commit comments

Comments
 (0)