summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--builtin-diff.c6
-rw-r--r--git.c2
2 files changed, 7 insertions, 1 deletions
diff --git a/builtin-diff.c b/builtin-diff.c
index b48121e6e2..8dc17b0dd7 100644
--- a/builtin-diff.c
+++ b/builtin-diff.c
@@ -235,6 +235,12 @@ int cmd_diff(int argc, const char **argv, const char *prefix)
rev.diffopt.allow_external = 1;
rev.diffopt.recursive = 1;
+ /* 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 (!rev.diffopt.exit_with_status)
+ setup_pager();
+
/* Do we have --cached and not have a pending object, then
* default to HEAD by hand. Eek.
*/
diff --git a/git.c b/git.c
index e5daae0f95..cab0e7227d 100644
--- a/git.c
+++ b/git.c
@@ -325,7 +325,7 @@ static void handle_internal_command(int argc, const char **argv)
{ "config", cmd_config },
{ "count-objects", cmd_count_objects, RUN_SETUP },
{ "describe", cmd_describe, RUN_SETUP },
- { "diff", cmd_diff, USE_PAGER },
+ { "diff", cmd_diff },
{ "diff-files", cmd_diff_files },
{ "diff-index", cmd_diff_index, RUN_SETUP },
{ "diff-tree", cmd_diff_tree, RUN_SETUP },