path: root/merge-recursive.h
diff options
authorElijah Newren <>2018-02-14 18:51:57 (GMT)
committerJunio C Hamano <>2018-02-14 21:02:53 (GMT)
commitea625cb0274c6907fba02f7af3ab83458b331a1e (patch)
tree2ece0a842eb7e4c79c707fc43ab984c4bbcb4247 /merge-recursive.h
parent53e32d4652a5cb073c8add8e7867fd7e76c2deff (diff)
merge-recursive: add computation of collisions due to dir rename & merging
directory renaming and merging can cause one or more files to be moved to where an existing file is, or to cause several files to all be moved to the same (otherwise vacant) location. Add checking and reporting for such cases, falling back to no-directory-rename handling for such paths. Reviewed-by: Stefan Beller <> Signed-off-by: Elijah Newren <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'merge-recursive.h')
1 files changed, 7 insertions, 0 deletions
diff --git a/merge-recursive.h b/merge-recursive.h
index fe64c78..50a4e6a 100644
--- a/merge-recursive.h
+++ b/merge-recursive.h
@@ -47,6 +47,13 @@ struct dir_rename_entry {
struct string_list possible_new_dirs;
+struct collision_entry {
+ struct hashmap_entry ent; /* must be the first member! */
+ char *target_file;
+ struct string_list source_files;
+ unsigned reported_already:1;
/* merge_trees() but with recursive ancestor consolidation */
int merge_recursive(struct merge_options *o,
struct commit *h1,