diff options
author | Elijah Newren <newren@gmail.com> | 2021-02-27 03:30:43 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-02-27 04:53:11 +0300 |
commit | cd52e0050f0aa18bb35cda08f2dcbe94943df2cf (patch) | |
tree | c891379e2d92daad57fffaa88209685e735cde8f /merge-ort.c | |
parent | 0c4fd732f043be570e08b51c475ff9f2e2066912 (diff) |
diffcore-rename: add function for clearing dir_rename_count
As we adjust the usage of dir_rename_count we want to have a function
for clearing, or partially clearing it out. Add a
partial_clear_dir_rename_count() function for this purpose.
Reviewed-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'merge-ort.c')
-rw-r--r-- | merge-ort.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/merge-ort.c b/merge-ort.c index c4467e073b..467404cc0a 100644 --- a/merge-ort.c +++ b/merge-ort.c @@ -351,17 +351,11 @@ static void clear_or_reinit_internal_opts(struct merge_options_internal *opti, /* Free memory used by various renames maps */ for (i = MERGE_SIDE1; i <= MERGE_SIDE2; ++i) { - struct hashmap_iter iter; - struct strmap_entry *entry; - strset_func(&renames->dirs_removed[i]); - strmap_for_each_entry(&renames->dir_rename_count[i], - &iter, entry) { - struct strintmap *counts = entry->value; - strintmap_clear(counts); - } - strmap_func(&renames->dir_rename_count[i], 1); + partial_clear_dir_rename_count(&renames->dir_rename_count[i]); + if (!reinitialize) + strmap_clear(&renames->dir_rename_count[i], 1); strmap_func(&renames->dir_renames[i], 0); } |