]> git.ipfire.org Git - thirdparty/git.git/blobdiff - merge-ort.c
merge-ort: fix issue with dual rename and add/add conflict
[thirdparty/git.git] / merge-ort.c
index a37c1c19aca1578f5ee48da9e55ffcd2b3828775..3855f9de25e662da4211165ff09c5002c03c1e54 100644 (file)
@@ -2292,10 +2292,16 @@ static char *check_for_directory_rename(struct merge_options *opt,
        struct strmap_entry *rename_info;
        struct strmap_entry *otherinfo;
        const char *new_dir;
+       int other_side = 3 - side_index;
 
-       /* Cases where we don't have a directory rename for this path */
+       /*
+        * Cases where we don't have or don't want a directory rename for
+        * this path.
+        */
        if (strmap_empty(dir_renames))
                return NULL;
+       if (strmap_get(&collisions[other_side], path))
+               return NULL;
        rename_info = check_dir_renamed(path, dir_renames);
        if (!rename_info)
                return NULL;