mirror of
https://github.com/git-for-windows/git.git
synced 2025-12-15 04:04:52 -06:00
diff: add option to skip resolving diff statuses
By default, `diffcore_std()` resolves the statuses for queued diff file pairs by calling `diff_resolve_rename_copy()`. If status information is already manually set, invoking `diffcore_std()` may change the status value. Introduce the `skip_resolving_statuses` diff option that prevents `diffcore_std()` from resolving file pair statuses when enabled. Signed-off-by: Justin Tobler <jltobler@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
7c67d2a070
commit
c8a8e04099
2
diff.c
2
diff.c
@ -7085,7 +7085,7 @@ void diffcore_std(struct diff_options *options)
|
|||||||
diffcore_order(options->orderfile);
|
diffcore_order(options->orderfile);
|
||||||
if (options->rotate_to)
|
if (options->rotate_to)
|
||||||
diffcore_rotate(options);
|
diffcore_rotate(options);
|
||||||
if (!options->found_follow)
|
if (!options->found_follow && !options->skip_resolving_statuses)
|
||||||
/* See try_to_follow_renames() in tree-diff.c */
|
/* See try_to_follow_renames() in tree-diff.c */
|
||||||
diff_resolve_rename_copy();
|
diff_resolve_rename_copy();
|
||||||
diffcore_apply_filter(options);
|
diffcore_apply_filter(options);
|
||||||
|
|||||||
8
diff.h
8
diff.h
@ -353,6 +353,14 @@ struct diff_options {
|
|||||||
/* to support internal diff recursion by --follow hack*/
|
/* to support internal diff recursion by --follow hack*/
|
||||||
int found_follow;
|
int found_follow;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* By default, diffcore_std() resolves the statuses for queued diff file
|
||||||
|
* pairs by calling diff_resolve_rename_copy(). If status information
|
||||||
|
* has already been manually set, this option prevents diffcore_std()
|
||||||
|
* from resetting statuses.
|
||||||
|
*/
|
||||||
|
int skip_resolving_statuses;
|
||||||
|
|
||||||
/* Callback which allows tweaking the options in diff_setup_done(). */
|
/* Callback which allows tweaking the options in diff_setup_done(). */
|
||||||
void (*set_default)(struct diff_options *);
|
void (*set_default)(struct diff_options *);
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user