]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'en/merge-dual-dir-renames-fix'
authorJunio C Hamano <gitster@pobox.com>
Mon, 18 Jul 2022 20:31:56 +0000 (13:31 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 18 Jul 2022 20:31:56 +0000 (13:31 -0700)
Fixes a long-standing corner case bug around directory renames in
the merge-ort strategy.

* en/merge-dual-dir-renames-fix:
  merge-ort: fix issue with dual rename and add/add conflict
  merge-ort: shuffle the computation and cleanup of potential collisions
  merge-ort: make a separate function for freeing struct collisions
  merge-ort: small cleanups of check_for_directory_rename
  t6423: add tests of dual directory rename plus add/add conflict

1  2 
merge-ort.c

diff --cc merge-ort.c
index 01f150ef3b56bb693a1d8c466ca129aa3835eb57,3855f9de25e662da4211165ff09c5002c03c1e54..8b7de0fbd8e87118aad09fad3be8ef77cd0bdbbc
@@@ -2443,10 -2330,10 +2469,11 @@@ static char *check_for_directory_rename
         * As it turns out, this also prevents N-way transient rename
         * confusion; See testcases 9c and 9d of t6043.
         */
+       new_dir = rename_info->value; /* old_dir = rename_info->key; */
        otherinfo = strmap_get_entry(dir_rename_exclusions, new_dir);
        if (otherinfo) {
 -              path_msg(opt, rename_info->key, 1,
 +              path_msg(opt, INFO_DIR_RENAME_SKIPPED_DUE_TO_RERENAME, 1,
 +                       rename_info->key, path, new_dir, NULL,
                         _("WARNING: Avoiding applying %s -> %s rename "
                           "to %s, because %s itself was renamed."),
                         rename_info->key, new_dir, path, new_dir);