summaryrefslogtreecommitdiff
path: root/diffcore-rename.c
diff options
context:
space:
mode:
authorElijah Newren <newren@gmail.com>2021-02-27 00:30:43 (GMT)
committerJunio C Hamano <gitster@pobox.com>2021-02-27 01:53:11 (GMT)
commitcd52e0050f0aa18bb35cda08f2dcbe94943df2cf (patch)
treec891379e2d92daad57fffaa88209685e735cde8f /diffcore-rename.c
parent0c4fd732f043be570e08b51c475ff9f2e2066912 (diff)
downloadgit-cd52e0050f0aa18bb35cda08f2dcbe94943df2cf.zip
git-cd52e0050f0aa18bb35cda08f2dcbe94943df2cf.tar.gz
git-cd52e0050f0aa18bb35cda08f2dcbe94943df2cf.tar.bz2
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 'diffcore-rename.c')
-rw-r--r--diffcore-rename.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/diffcore-rename.c b/diffcore-rename.c
index 39e23d5..7dd475f 100644
--- a/diffcore-rename.c
+++ b/diffcore-rename.c
@@ -528,6 +528,18 @@ static void initialize_dir_rename_info(struct dir_rename_info *info)
}
}
+void partial_clear_dir_rename_count(struct strmap *dir_rename_count)
+{
+ struct hashmap_iter iter;
+ struct strmap_entry *entry;
+
+ strmap_for_each_entry(dir_rename_count, &iter, entry) {
+ struct strintmap *counts = entry->value;
+ strintmap_clear(counts);
+ }
+ strmap_partial_clear(dir_rename_count, 1);
+}
+
static void cleanup_dir_rename_info(struct dir_rename_info *info)
{
if (!info->setup)