From 3e986cdf54e3c83174aa782dc42fc10ff5b6fd6f Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Fri, 22 Jan 2021 15:25:35 +0000 Subject: [PATCH] dedup: add warning if used on a remote which can't have duplicate names --- cmd/dedupe/dedupe.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmd/dedupe/dedupe.go b/cmd/dedupe/dedupe.go index 7d5e0767c..d45bea01a 100644 --- a/cmd/dedupe/dedupe.go +++ b/cmd/dedupe/dedupe.go @@ -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) })