diff options
Diffstat (limited to 'internal/engine/apply.go')
| -rw-r--r-- | internal/engine/apply.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/internal/engine/apply.go b/internal/engine/apply.go index 878cb18..ce05636 100644 --- a/internal/engine/apply.go +++ b/internal/engine/apply.go @@ -476,6 +476,15 @@ func planUndoFile(file string, ents []journal.Entry) UndoFile { break } step := reverseStep(en) + if (en.Action == "move" || en.Action == "rename") && proj.occupied[en.Dst] { + // A reversal already queued for this same file puts it back at + // en.Dst before this one runs, and that reversal was checked + // against the disk itself. Judged against the disk as it is now, + // en.Dst is empty - a later step of the chain moved the file on - + // and every rename-then-move, move-then-move or move-then-trash + // chain would be refused (plan 8, found by the property test). + step.Refused = "" + } if step.Refused == "" { step.Refused = refuseIfSrcExists(step, proj) } |
