From 0c4fd732f043be570e08b51c475ff9f2e2066912 Mon Sep 17 00:00:00 2001 From: Elijah Newren Date: Sat, 27 Feb 2021 00:30:42 +0000 Subject: Move computation of dir_rename_count from merge-ort to diffcore-rename Move the computation of dir_rename_count from merge-ort.c to diffcore-rename.c, making slight adjustments to the data structures based on the move. While the diffstat looks large, viewing this commit with --color-moved makes it clear that only about 20 lines changed. With this patch, the computation of dir_rename_count is still only done after inexact rename detection, but subsequent commits will add a preliminary computation of dir_rename_count after exact rename detection, followed by some updates after inexact rename detection. Reviewed-by: Derrick Stolee Signed-off-by: Elijah Newren Signed-off-by: Junio C Hamano --- diffcore.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'diffcore.h') diff --git a/diffcore.h b/diffcore.h index d2a63c5c71..db55d38530 100644 --- a/diffcore.h +++ b/diffcore.h @@ -8,6 +8,8 @@ struct diff_options; struct repository; +struct strmap; +struct strset; struct userdiff_driver; /* This header file is internal between diff.c and its diff transformers @@ -161,6 +163,9 @@ void diff_q(struct diff_queue_struct *, struct diff_filepair *); void diffcore_break(struct repository *, int); void diffcore_rename(struct diff_options *); +void diffcore_rename_extended(struct diff_options *options, + struct strset *dirs_removed, + struct strmap *dir_rename_count); void diffcore_merge_broken(void); void diffcore_pickaxe(struct diff_options *); void diffcore_order(const char *orderfile); -- cgit v1.2.3 From cd52e0050f0aa18bb35cda08f2dcbe94943df2cf Mon Sep 17 00:00:00 2001 From: Elijah Newren Date: Sat, 27 Feb 2021 00:30:43 +0000 Subject: 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 Signed-off-by: Elijah Newren Signed-off-by: Junio C Hamano --- diffcore.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'diffcore.h') diff --git a/diffcore.h b/diffcore.h index db55d38530..c6ba64abd1 100644 --- a/diffcore.h +++ b/diffcore.h @@ -161,6 +161,8 @@ struct diff_filepair *diff_queue(struct diff_queue_struct *, struct diff_filespec *); void diff_q(struct diff_queue_struct *, struct diff_filepair *); +void partial_clear_dir_rename_count(struct strmap *dir_rename_count); + void diffcore_break(struct repository *, int); void diffcore_rename(struct diff_options *); void diffcore_rename_extended(struct diff_options *options, -- cgit v1.2.3