forked from TrueCloudLab/rclone
fs: when creating new fs.OverrideRemotes don't layer overrides if not needed
This commit is contained in:
parent
d6667d34e7
commit
c18c66f167
1 changed files with 7 additions and 0 deletions
|
@ -12,6 +12,13 @@ type OverrideRemote struct {
|
||||||
// NewOverrideRemote returns an OverrideRemoteObject which will
|
// NewOverrideRemote returns an OverrideRemoteObject which will
|
||||||
// return the remote specified
|
// return the remote specified
|
||||||
func NewOverrideRemote(oi ObjectInfo, remote string) *OverrideRemote {
|
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{
|
return &OverrideRemote{
|
||||||
ObjectInfo: oi,
|
ObjectInfo: oi,
|
||||||
remote: remote,
|
remote: remote,
|
||||||
|
|
Loading…
Reference in a new issue