local: --local-no-clone flag to disable cloning for server-side copies

This flag allows users to disable the reflink cloning feature and instead force
"deep" copies, for certain use cases where data redundancy is preferable. It is
functionally equivalent to using `--disable Copy` on local.
This commit is contained in:
nielash
2024-08-13 02:58:54 -04:00
committed by Nick Craig-Wood
parent f6d836eefd
commit bd5199910b
2 changed files with 148 additions and 104 deletions

View File

@ -22,7 +22,7 @@ import (
//
// If it isn't possible then return fs.ErrorCantCopy
func (f *Fs) Copy(ctx context.Context, src fs.Object, remote string) (fs.Object, error) {
if runtime.GOOS != "darwin" || f.opt.TranslateSymlinks {
if runtime.GOOS != "darwin" || f.opt.TranslateSymlinks || f.opt.NoClone {
return nil, fs.ErrorCantCopy
}
srcObj, ok := src.(*Object)