1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-28 18:36:46 +02:00

git diff --no-index: default to page like other diff frontends

Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Junio C Hamano 2008-05-26 22:35:07 -07:00
parent 040366076f
commit b3fde6ccb1

View File

@ -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;