move: if --check-first and --order-by are set then delete with perfect ordering
If using rclone move and --check-first and --order-by then rclone uses the transfer routine to delete files to ensure perfect ordering. This will cause the transfer stats to have a larger than expected number of items in it so we don't enable this by default. Fixes #6033
This commit is contained in:
parent
4edcd16f5f
commit
dd6e229327
4 changed files with 38 additions and 4 deletions
|
@ -42,12 +42,18 @@ func TestPipe(t *testing.T) {
|
|||
obj1 := mockobject.New("potato").WithContent([]byte("hello"), mockobject.SeekModeNone)
|
||||
|
||||
pair1 := fs.ObjectPair{Src: obj1, Dst: nil}
|
||||
pairD := fs.ObjectPair{Src: obj1, Dst: obj1} // this object should not count to the stats
|
||||
|
||||
// Put an object
|
||||
ok := p.Put(ctx, pair1)
|
||||
assert.Equal(t, true, ok)
|
||||
checkStats(1, 5)
|
||||
|
||||
// Put an object to be deleted
|
||||
ok = p.Put(ctx, pairD)
|
||||
assert.Equal(t, true, ok)
|
||||
checkStats(2, 5)
|
||||
|
||||
// Close the pipe showing reading on closed pipe is OK
|
||||
p.Close()
|
||||
|
||||
|
@ -55,6 +61,12 @@ func TestPipe(t *testing.T) {
|
|||
pair2, ok := p.Get(ctx)
|
||||
assert.Equal(t, pair1, pair2)
|
||||
assert.Equal(t, true, ok)
|
||||
checkStats(1, 0)
|
||||
|
||||
// Read from pipe
|
||||
pair2, ok = p.Get(ctx)
|
||||
assert.Equal(t, pairD, pair2)
|
||||
assert.Equal(t, true, ok)
|
||||
checkStats(0, 0)
|
||||
|
||||
// Check read on closed pipe
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue