aboutsummaryrefslogtreecommitdiff
path: root/internal/persistence/txn.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/persistence/txn.go')
-rw-r--r--internal/persistence/txn.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/internal/persistence/txn.go b/internal/persistence/txn.go
index 8ba21fa..9939204 100644
--- a/internal/persistence/txn.go
+++ b/internal/persistence/txn.go
@@ -201,8 +201,10 @@ func (t *Transaction) Move(oldPath, newPath string) error {
if dst.Kind != kindMoveTarget && dst.Kind != "" {
return fmt.Errorf("conflicting operation on %s", newPath)
}
- // An existing replace/delete on the destination becomes a move-target
- // (the destination's before-image governs rollback).
+ // The destination must not already carry a replace/delete: callers must
+ // issue Move before any Replace on the destination. A destination already
+ // recorded as a move-target (a chained move) keeps its before-image for
+ // rollback.
dst.Kind = kindMoveTarget
src.Kind = kindMove
src.MoveTo = newPath