From c8a8e04099a99d6eafbe6e9bb1db3b50996836f8 Mon Sep 17 00:00:00 2001 From: Justin Tobler Date: Fri, 28 Feb 2025 15:33:44 -0600 Subject: 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 Signed-off-by: Junio C Hamano --- diff.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'diff.c') diff --git a/diff.c b/diff.c index 4ddfe523fe..08f5e00a2c 100644 --- a/diff.c +++ b/diff.c @@ -7085,7 +7085,7 @@ void diffcore_std(struct diff_options *options) diffcore_order(options->orderfile); if (options->rotate_to) diffcore_rotate(options); - if (!options->found_follow) + if (!options->found_follow && !options->skip_resolving_statuses) /* See try_to_follow_renames() in tree-diff.c */ diff_resolve_rename_copy(); diffcore_apply_filter(options); -- cgit 1.2.3-korg