aboutsummaryrefslogtreecommitdiffstats
path: root/diff.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2025-12-14 17:04:36 +0900
committerJunio C Hamano <gitster@pobox.com>2025-12-14 17:04:36 +0900
commit84ca5a2457757e8997ddcaa64e8c26372359965c (patch)
tree473ac74a8da8c8c4cc4b0de707c7179aea5674b3 /diff.c
parent794c9798893670dcf8f52952487217cb04a478c4 (diff)
parent38f88051dae6ddb2f1cdb9c7415d4ba6caef04af (diff)
downloadgit-84ca5a2457757e8997ddcaa64e8c26372359965c.tar.gz
Merge branch 'rs/diff-index-find-copies-harder-optim'
Halve the memory consumed by artificial filepairs created during "git diff --find-copioes-harder", also making the operation run faster. * rs/diff-index-find-copies-harder-optim: diff-index: don't queue unchanged filepairs with diff_change()
Diffstat (limited to 'diff.c')
-rw-r--r--diff.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/diff.c b/diff.c
index f66dd7ff6b..436da250eb 100644
--- a/diff.c
+++ b/diff.c
@@ -7399,6 +7399,26 @@ void diff_change(struct diff_options *options,
concatpath, old_dirty_submodule, new_dirty_submodule);
}
+void diff_same(struct diff_options *options,
+ unsigned mode,
+ const struct object_id *oid,
+ const char *concatpath)
+{
+ struct diff_filespec *one;
+
+ if (S_ISGITLINK(mode) && is_submodule_ignored(concatpath, options))
+ return;
+
+ if (options->prefix &&
+ strncmp(concatpath, options->prefix, options->prefix_length))
+ return;
+
+ one = alloc_filespec(concatpath);
+ fill_filespec(one, oid, 1, mode);
+ one->count++;
+ diff_queue(&diff_queued_diff, one, one);
+}
+
struct diff_filepair *diff_unmerge(struct diff_options *options, const char *path)
{
struct diff_filepair *pair;