diff options
author | Junio C Hamano <gitster@pobox.com> | 2007-12-14 21:42:53 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2007-12-14 21:42:53 -0800 |
commit | dfaf75b4698833d820e77e9f42ef93f3b6d3669d (patch) | |
tree | af298a982053033eab62dcff0650d3eb18b37cc6 /builtin-diff.c | |
parent | d7e92806cdc5ca78c4db879c68f91c70ff9e1ade (diff) | |
parent | 5973a07937f2c64b595c6784b06eb4441c07b5ef (diff) | |
download | git-dfaf75b4698833d820e77e9f42ef93f3b6d3669d.tar.gz |
Merge branch 'wc/diff'
* wc/diff:
Test interaction between diff --check and --exit-code
Use shorter error messages for whitespace problems
Add tests for "git diff --check" with core.whitespace options
Make "diff --check" output match "git apply"
Unify whitespace checking
diff --check: minor fixups
"diff --check" should affect exit status
Diffstat (limited to 'builtin-diff.c')
-rw-r--r-- | builtin-diff.c | 7 |
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; |