1
mirror of https://github.com/rclone/rclone synced 2024-11-20 21:27:33 +01:00

fs: when creating new fs.OverrideRemotes don't layer overrides if not needed

This commit is contained in:
Nick Craig-Wood 2023-05-04 17:49:39 +01:00
parent d6667d34e7
commit c18c66f167

View File

@ -12,6 +12,13 @@ type OverrideRemote struct {
// NewOverrideRemote returns an OverrideRemoteObject which will
// return the remote specified
func NewOverrideRemote(oi ObjectInfo, remote string) *OverrideRemote {
// re-wrap an OverrideRemote
if or, ok := oi.(*OverrideRemote); ok {
return &OverrideRemote{
ObjectInfo: or.ObjectInfo,
remote: remote,
}
}
return &OverrideRemote{
ObjectInfo: oi,
remote: remote,