summaryrefslogtreecommitdiff
path: root/builtin-diff.c
diff options
context:
space:
mode:
Diffstat (limited to 'builtin-diff.c')
-rw-r--r--builtin-diff.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/builtin-diff.c b/builtin-diff.c
index 55fb84c730..29365a0b17 100644
--- a/builtin-diff.c
+++ b/builtin-diff.c
@@ -244,7 +244,8 @@ int cmd_diff(int argc, const char **argv, const char *prefix)
DIFF_OPT_SET(&rev.diffopt, ALLOW_EXTERNAL);
DIFF_OPT_SET(&rev.diffopt, RECURSIVE);
- /* If the user asked for our exit code then don't start a
+ /*
+ * 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(&rev.diffopt, EXIT_WITH_STATUS))
@@ -351,9 +352,7 @@ int cmd_diff(int argc, const char **argv, const char *prefix)
else
result = builtin_diff_combined(&rev, argc, argv,
ent, ents);
- if (DIFF_OPT_TST(&rev.diffopt, EXIT_WITH_STATUS))
- result = DIFF_OPT_TST(&rev.diffopt, HAS_CHANGES) != 0;
-
+ result = diff_result_code(&rev.diffopt, result);
if (1 < rev.diffopt.skip_stat_unmatch)
refresh_index_quietly();
return result;