diff options
author | Junio C Hamano <gitster@pobox.com> | 2023-09-01 11:26:28 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2023-09-01 11:26:28 -0700 |
commit | f137bd4358bba70cede3e3198cbd50fd656b70a9 (patch) | |
tree | 6c25f371df114aa979177043cab44bbdf1e383cc /wt-status.c | |
parent | 3525f1dbc18ae36ca9c671e807d6aac2ac432600 (diff) | |
parent | 5cc6b2d70bc55ab75913ee93d9ac96ad875fbb29 (diff) | |
download | git-f137bd4358bba70cede3e3198cbd50fd656b70a9.tar.gz |
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 'wt-status.c')
-rw-r--r-- | wt-status.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/wt-status.c b/wt-status.c index bdbcf73cbf..d03dfab9e4 100644 --- a/wt-status.c +++ b/wt-status.c @@ -675,7 +675,7 @@ static void wt_status_collect_changes_index(struct wt_status *s) rev.diffopt.flags.recursive = 1; copy_pathspec(&rev.prune_data, &s->pathspec); - run_diff_index(&rev, 1); + run_diff_index(&rev, DIFF_INDEX_CACHED); release_revisions(&rev); } @@ -1156,7 +1156,7 @@ static void wt_longstatus_print_verbose(struct wt_status *s) rev.diffopt.a_prefix = "c/"; rev.diffopt.b_prefix = "i/"; } /* else use prefix as per user config */ - run_diff_index(&rev, 1); + run_diff_index(&rev, DIFF_INDEX_CACHED); if (s->verbose > 1 && wt_status_check_worktree_changes(s, &dirty_submodules)) { status_printf_ln(s, c, @@ -2580,8 +2580,8 @@ int has_unstaged_changes(struct repository *r, int ignore_submodules) } rev_info.diffopt.flags.quick = 1; diff_setup_done(&rev_info.diffopt); - result = run_diff_files(&rev_info, 0); - result = diff_result_code(&rev_info.diffopt, result); + run_diff_files(&rev_info, 0); + result = diff_result_code(&rev_info.diffopt); release_revisions(&rev_info); return result; } @@ -2614,8 +2614,8 @@ int has_uncommitted_changes(struct repository *r, } diff_setup_done(&rev_info.diffopt); - result = run_diff_index(&rev_info, 1); - result = diff_result_code(&rev_info.diffopt, result); + run_diff_index(&rev_info, DIFF_INDEX_CACHED); + result = diff_result_code(&rev_info.diffopt); release_revisions(&rev_info); return result; } |