Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/diff.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2023-09-01 21:26:28 +0300
committerJunio C Hamano <gitster@pobox.com>2023-09-01 21:26:28 +0300
commitf137bd4358bba70cede3e3198cbd50fd656b70a9 (patch)
tree6c25f371df114aa979177043cab44bbdf1e383cc /diff.c
parent3525f1dbc18ae36ca9c671e807d6aac2ac432600 (diff)
parent5cc6b2d70bc55ab75913ee93d9ac96ad875fbb29 (diff)
Merge branch 'jk/diff-result-code-cleanup'
"git diff --no-such-option" and other corner cases around the exit status of the "diff" command has been corrected. * jk/diff-result-code-cleanup: diff: drop useless "status" parameter from diff_result_code() diff: drop useless return values in git-diff helpers diff: drop useless return from run_diff_{files,index} functions diff: die when failing to read index in git-diff builtin diff: show usage for unknown builtin_diff_files() options diff-files: avoid negative exit value diff: spell DIFF_INDEX_CACHED out when calling run_diff_index()
Diffstat (limited to 'diff.c')
-rw-r--r--diff.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/diff.c b/diff.c
index 28ba229476..bccb018da4 100644
--- a/diff.c
+++ b/diff.c
@@ -6982,16 +6982,14 @@ void diffcore_std(struct diff_options *options)
options->found_follow = 0;
}
-int diff_result_code(struct diff_options *opt, int status)
+int diff_result_code(struct diff_options *opt)
{
int result = 0;
diff_warn_rename_limit("diff.renameLimit",
opt->needed_rename_limit,
opt->degraded_cc_to_c);
- if (!opt->flags.exit_with_status &&
- !(opt->output_format & DIFF_FORMAT_CHECKDIFF))
- return status;
+
if (opt->flags.exit_with_status &&
opt->flags.has_changes)
result |= 01;