mirror of
https://github.com/rclone/rclone.git
synced 2025-08-18 09:30:03 +02:00
sync: implement --ignore-errors - fixes #642
This commit is contained in:
committed by
Nick Craig-Wood
parent
b52e34ef5e
commit
91b068ad3a
@@ -283,6 +283,78 @@ func TestSyncIgnoreExisting(t *testing.T) {
|
||||
fstest.CheckItems(t, r.Fremote, file1)
|
||||
}
|
||||
|
||||
func TestSyncIgnoreErrors(t *testing.T) {
|
||||
r := fstest.NewRun(t)
|
||||
fs.Config.IgnoreErrors = true
|
||||
defer func() {
|
||||
fs.Config.IgnoreErrors = false
|
||||
r.Finalise()
|
||||
}()
|
||||
file1 := r.WriteFile("a/potato2", "------------------------------------------------------------", t1)
|
||||
file2 := r.WriteObject("b/potato", "SMALLER BUT SAME DATE", t2)
|
||||
file3 := r.WriteBoth("c/non empty space", "AhHa!", t2)
|
||||
require.NoError(t, operations.Mkdir(r.Fremote, "d"))
|
||||
|
||||
fstest.CheckListingWithPrecision(
|
||||
t,
|
||||
r.Flocal,
|
||||
[]fstest.Item{
|
||||
file1,
|
||||
file3,
|
||||
},
|
||||
[]string{
|
||||
"a",
|
||||
"c",
|
||||
},
|
||||
fs.Config.ModifyWindow,
|
||||
)
|
||||
fstest.CheckListingWithPrecision(
|
||||
t,
|
||||
r.Fremote,
|
||||
[]fstest.Item{
|
||||
file2,
|
||||
file3,
|
||||
},
|
||||
[]string{
|
||||
"b",
|
||||
"c",
|
||||
"d",
|
||||
},
|
||||
fs.Config.ModifyWindow,
|
||||
)
|
||||
|
||||
accounting.Stats.ResetCounters()
|
||||
fs.CountError(nil)
|
||||
assert.NoError(t, Sync(r.Fremote, r.Flocal))
|
||||
|
||||
fstest.CheckListingWithPrecision(
|
||||
t,
|
||||
r.Flocal,
|
||||
[]fstest.Item{
|
||||
file1,
|
||||
file3,
|
||||
},
|
||||
[]string{
|
||||
"a",
|
||||
"c",
|
||||
},
|
||||
fs.Config.ModifyWindow,
|
||||
)
|
||||
fstest.CheckListingWithPrecision(
|
||||
t,
|
||||
r.Fremote,
|
||||
[]fstest.Item{
|
||||
file1,
|
||||
file3,
|
||||
},
|
||||
[]string{
|
||||
"a",
|
||||
"c",
|
||||
},
|
||||
fs.Config.ModifyWindow,
|
||||
)
|
||||
}
|
||||
|
||||
func TestSyncAfterChangingModtimeOnly(t *testing.T) {
|
||||
r := fstest.NewRun(t)
|
||||
defer r.Finalise()
|
||||
|
Reference in New Issue
Block a user