summaryrefslogtreecommitdiff
path: root/builtin-diff-index.c
diff options
context:
space:
mode:
Diffstat (limited to 'builtin-diff-index.c')
-rw-r--r--builtin-diff-index.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/builtin-diff-index.c b/builtin-diff-index.c
index 81e7167438..556c506bfa 100644
--- a/builtin-diff-index.c
+++ b/builtin-diff-index.c
@@ -44,5 +44,7 @@ int cmd_diff_index(int argc, const char **argv, const char *prefix)
return -1;
}
result = run_diff_index(&rev, cached);
- return rev.diffopt.exit_with_status ? rev.diffopt.has_changes: result;
+ if (DIFF_OPT_TST(&rev.diffopt, EXIT_WITH_STATUS))
+ return DIFF_OPT_TST(&rev.diffopt, HAS_CHANGES) != 0;
+ return result;
}