fix: Support no-op move operation
This commit is contained in:
@@ -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()
|
||||
|
||||
|
||||
@@ -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]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user