Commit f48b331
committed
merge-ort: fix slightly overzealous assertion for rename-to-self
merge-ort has a number of sanity checks on the file it is processing in
process_renames(). One of these sanity checks was slightly overzealous
because it indirectly assumed that a renamed file always ended up at a
different path than where it started. That is normally an entirely fair
assumption, but directory rename detection can make things interesting.
As a quick refresher, if one side of history renames directory A/ -> B/,
and the other side of history adds new files to A/, then directory
rename detection notices and suggests moving those new files to B/. A
similar thing is done for paths renamed into A/, causing them to be
transitively renamed into B/. But, if the file originally came from B/,
then this can end up causing a file to be renamed back to itself.
It turns out the rest of the code following this assertion handled the
case fine; the assertion was just an extra sanity check, not a rigid
precondition. Therefore, simply adjust the assertion to pass under this
special case as well.
Signed-off-by: Elijah Newren <[email protected]>1 parent 69da363 commit f48b331
2 files changed
+3
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3048 | 3048 | | |
3049 | 3049 | | |
3050 | 3050 | | |
3051 | | - | |
| 3051 | + | |
| 3052 | + | |
3052 | 3053 | | |
3053 | 3054 | | |
3054 | 3055 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5388 | 5388 | | |
5389 | 5389 | | |
5390 | 5390 | | |
5391 | | - | |
| 5391 | + | |
5392 | 5392 | | |
5393 | 5393 | | |
5394 | 5394 | | |
| |||
0 commit comments