summaryrefslogtreecommitdiff
path: root/diff-no-index.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-05-26 22:35:07 -0700
committerJunio C Hamano <gitster@pobox.com>2008-05-26 22:35:07 -0700
commitb3fde6ccb1cbdd362dec19e317905f71528b3a53 (patch)
tree73b8418a2bbbe0daa3decd6259555293130cb9ce /diff-no-index.c
parent040366076fa0dc540309531997a987cc6d83a577 (diff)
downloadgit-b3fde6ccb1cbdd362dec19e317905f71528b3a53.tar.gz
git diff --no-index: default to page like other diff frontends
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'diff-no-index.c')
-rw-r--r--diff-no-index.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/diff-no-index.c b/diff-no-index.c
index b1ae7912c1..f6994cf5fb 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;