sync,copy,move: add --check-first to do all checking before starting transfers

See: https://forum.rclone.org/t/rclone-sync-doing-transfer-and-checking-in-paralel/16352/
This commit is contained in:
Nick Craig-Wood 2020-05-15 11:39:07 +01:00
parent 147f97d1f7
commit 518d39815c
5 changed files with 50 additions and 4 deletions

View file

@ -97,6 +97,23 @@ func TestCopyNoTraverse(t *testing.T) {
fstest.CheckItems(t, r.Fremote, file1)
}
// Now with --check-first
func TestCopyCheckFirst(t *testing.T) {
r := fstest.NewRun(t)
defer r.Finalise()
fs.Config.CheckFirst = true
defer func() { fs.Config.CheckFirst = false }()
file1 := r.WriteFile("sub dir/hello world", "hello world", t1)
err := CopyDir(context.Background(), r.Fremote, r.Flocal, false)
require.NoError(t, err)
fstest.CheckItems(t, r.Flocal, file1)
fstest.CheckItems(t, r.Fremote, file1)
}
// Now with --no-traverse
func TestSyncNoTraverse(t *testing.T) {
r := fstest.NewRun(t)