summaryrefslogtreecommitdiff
path: root/merge-recursive.h
diff options
context:
space:
mode:
authorElijah Newren <newren@gmail.com>2018-02-14 10:51:57 -0800
committerJunio C Hamano <gitster@pobox.com>2018-02-14 13:02:53 -0800
commitea625cb0274c6907fba02f7af3ab83458b331a1e (patch)
tree2ece0a842eb7e4c79c707fc43ab984c4bbcb4247 /merge-recursive.h
parent53e32d4652a5cb073c8add8e7867fd7e76c2deff (diff)
downloadgit-ea625cb0274c6907fba02f7af3ab83458b331a1e.tar.gz
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>
Diffstat (limited to 'merge-recursive.h')
-rw-r--r--merge-recursive.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/merge-recursive.h b/merge-recursive.h
index fe64c78de4..50a4e6af4e 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,