fix: Support no-op move operation

This commit is contained in:
Felicitas Pojtinger
2021-12-17 15:53:53 +01:00
parent 2a67c243fd
commit 3948da5cfd
2 changed files with 6 additions and 1 deletions

View File

@@ -16,6 +16,11 @@ import (
)
func (o *Operations) Move(from string, to string) error {
// Ignore no-op move operation
if from == to {
return nil
}
o.diskOperationLock.Lock()
defer o.diskOperationLock.Unlock()

View File

@@ -298,7 +298,7 @@ func indexHeader(
case records.STFSRecordActionUpdate:
moveAfterEdits := false
oldName := hdr.Name
if _, ok := hdr.PAXRecords[records.STFSRecordReplacesName]; ok {
if _, ok := hdr.PAXRecords[records.STFSRecordReplacesName]; ok && oldName != hdr.Name {
moveAfterEdits = true
oldName = hdr.PAXRecords[records.STFSRecordReplacesName]
}