mirror of
https://github.com/rclone/rclone.git
synced 2024-11-23 02:34:40 +08:00
operations: display 'Deleted X extra copies' only if dedupe successful - fixes #3551
This commit is contained in:
parent
5c2dfeee46
commit
7712b780ba
|
@ -61,13 +61,19 @@ outer:
|
|||
|
||||
// dedupeDeleteAllButOne deletes all but the one in keep
|
||||
func dedupeDeleteAllButOne(ctx context.Context, keep int, remote string, objs []fs.Object) {
|
||||
count := 0
|
||||
for i, o := range objs {
|
||||
if i == keep {
|
||||
continue
|
||||
}
|
||||
_ = DeleteFile(ctx, o)
|
||||
err := DeleteFile(ctx, o)
|
||||
if err == nil {
|
||||
count++
|
||||
}
|
||||
}
|
||||
if count > 0 {
|
||||
fs.Logf(remote, "Deleted %d extra copies", count)
|
||||
}
|
||||
fs.Logf(remote, "Deleted %d extra copies", len(objs)-1)
|
||||
}
|
||||
|
||||
// dedupeDeleteIdentical deletes all but one of identical (by hash) copies
|
||||
|
|
Loading…
Reference in New Issue
Block a user