mirror of
https://github.com/git/git.git
synced 2026-01-10 01:56:42 +00:00
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()
This commit is contained in:
20
diff.c
20
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;
|
||||
|
||||
Reference in New Issue
Block a user