forked from TrueCloudLab/rclone
dedup: add warning if used on a remote which can't have duplicate names
This commit is contained in:
parent
b80d498304
commit
3e986cdf54
1 changed files with 4 additions and 0 deletions
|
@ -5,6 +5,7 @@ import (
|
||||||
"log"
|
"log"
|
||||||
|
|
||||||
"github.com/rclone/rclone/cmd"
|
"github.com/rclone/rclone/cmd"
|
||||||
|
"github.com/rclone/rclone/fs"
|
||||||
"github.com/rclone/rclone/fs/config/flags"
|
"github.com/rclone/rclone/fs/config/flags"
|
||||||
"github.com/rclone/rclone/fs/operations"
|
"github.com/rclone/rclone/fs/operations"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
|
@ -143,6 +144,9 @@ Or
|
||||||
args = args[1:]
|
args = args[1:]
|
||||||
}
|
}
|
||||||
fdst := cmd.NewFsSrc(args)
|
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 {
|
cmd.Run(false, false, command, func() error {
|
||||||
return operations.Deduplicate(context.Background(), fdst, dedupeMode, byHash)
|
return operations.Deduplicate(context.Background(), fdst, dedupeMode, byHash)
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue