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 <sbeller@google.com> Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
96e7ffbdc3
commit
e95ab70aac
@ -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,
|
||||
|
||||
Reference in New Issue
Block a user