mirror of
https://github.com/rclone/rclone.git
synced 2025-02-22 05:21:59 +01:00
dedup: add warning if used on a remote which can't have duplicate names
This commit is contained in:
parent
b80d498304
commit
3e986cdf54
@ -5,6 +5,7 @@ import (
|
||||
"log"
|
||||
|
||||
"github.com/rclone/rclone/cmd"
|
||||
"github.com/rclone/rclone/fs"
|
||||
"github.com/rclone/rclone/fs/config/flags"
|
||||
"github.com/rclone/rclone/fs/operations"
|
||||
"github.com/spf13/cobra"
|
||||
@ -143,6 +144,9 @@ Or
|
||||
args = args[1:]
|
||||
}
|
||||
fdst := cmd.NewFsSrc(args)
|
||||
if !byHash && !fdst.Features().DuplicateFiles {
|
||||
fs.Logf(fdst, "Can't have duplicate names here. Perhaps you wanted --by-hash ? Continuing anyway.")
|
||||
}
|
||||
cmd.Run(false, false, command, func() error {
|
||||
return operations.Deduplicate(context.Background(), fdst, dedupeMode, byHash)
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user