mirror of
https://github.com/jj-vcs/jj.git
synced 2026-08-03 06:41:37 +08:00
When diffing a merge commit, copy and rename detection runs once per parent, so a file renamed on a path present in several parents yields the same (source, target) copy record for each of them. `add_records` treated those duplicates as a target with multiple sources and poisoned both lookup maps. That dropped the deletion of the source and showed the target as a plain addition instead of a rename. Skip a record whose (source, target) pair was already recorded so the duplicate no longer looks like a conflict. Genuine conflicts, where a target has two different sources, are still discarded as before. The existing `test_diffedit_merge` was asserting the buggy output, where a copy made in a merge commit showed as a plain addition. Its snapshot now reports the copy, matching what the same edit produces against a single parent. Fixes #9752
31 KiB
31 KiB