1
0
mirror of https://github.com/rclone/rclone.git synced 2026-01-10 20:44:02 +00:00

fstest: skip Copy mutation test with --sftp-copy-is-hardlink

This commit is contained in:
Nick Craig-Wood
2026-01-09 12:43:26 +00:00
parent c0977d7a78
commit adff67ae3b

View File

@@ -1273,12 +1273,14 @@ func Run(t *testing.T, opt *Opt) {
assert.Equal(t, file2Copy.Path, dst.Remote())
// check that mutating dst does not mutate src
err = dst.SetModTime(ctx, fstest.Time("2004-03-03T04:05:06.499999999Z"))
if err != fs.ErrorCantSetModTimeWithoutDelete && err != fs.ErrorCantSetModTime {
assert.NoError(t, err)
// Re-read the source and check its modtime
src = fstest.NewObject(ctx, t, f, src.Remote())
assert.False(t, src.ModTime(ctx).Equal(dst.ModTime(ctx)), "mutating dst should not mutate src -- is it Copying by pointer?")
if !strings.Contains(fs.ConfigStringFull(f), "copy_is_hardlink") {
err = dst.SetModTime(ctx, fstest.Time("2004-03-03T04:05:06.499999999Z"))
if err != fs.ErrorCantSetModTimeWithoutDelete && err != fs.ErrorCantSetModTime {
assert.NoError(t, err)
// Re-read the source and check its modtime
src = fstest.NewObject(ctx, t, f, src.Remote())
assert.False(t, src.ModTime(ctx).Equal(dst.ModTime(ctx)), "mutating dst should not mutate src -- is it Copying by pointer?")
}
}
// Delete copy