From: Junio C Hamano Date: Tue, 27 May 2008 05:35:07 +0000 (-0700) Subject: git diff --no-index: default to page like other diff frontends X-Git-Tag: v1.5.6-rc1~41^2 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=b3fde6ccb1cbdd362dec19e317905f71528b3a53;p=git.git git diff --no-index: default to page like other diff frontends Signed-off-by: Junio C Hamano --- diff --git a/diff-no-index.c b/diff-no-index.c index b1ae7912c..f6994cf5f 100644 --- a/diff-no-index.c +++ b/diff-no-index.c @@ -198,6 +198,13 @@ 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;