Skip to content

"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files

convmv: make --dry-run logs less noisy

nielashd6ecb949cac6
diff --git a/fs/operations/operations.go b/fs/operations/operations.go
index f89284c4f..23f6f2111 100644
--- a/fs/operations/operations.go
+++ b/fs/operations/operations.go
@@ -428,6 +428,10 @@ func move(ctx context.Context, fdst fs.Fs, dst fs.Object, remote string, src fs.
origRemote := remote // avoid double-transform on fallback to copy
remote = transform.Path(ctx, remote, false)
ci := fs.GetConfig(ctx)
+ newDst = dst
+ if ci.DryRun && dst != nil && SameObject(src, dst) && src.Remote() == transform.Path(ctx, dst.Remote(), false) {
+ return // avoid SkipDestructive log for objects that won't really be moved
+ }
var tr *accounting.Transfer
if isTransfer {
tr = accounting.Stats(ctx).NewTransfer(src, fdst)
@@ -440,8 +444,11 @@ func move(ctx context.Context, fdst fs.Fs, dst fs.Object, remote string, src fs.
}
tr.Done(ctx, err)
}()
- newDst = dst
- if SkipDestructive(ctx, src, "move") {
+ action := "move"
+ if remote != src.Remote() {
+ action += " to " + remote
+ }
+ if SkipDestructive(ctx, src, action) {
in := tr.Account(ctx, nil)
in.DryRun(src.Size())
return newDst, nil