mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-02 07:18:25 +01:00
remote: use getattr instead of dict to get link methods
This commit is contained in:
+1
-8
@@ -406,16 +406,9 @@ class RemoteBASE(object):
|
||||
|
||||
@slow_link_guard
|
||||
def _try_links(self, from_info, to_info, link_types):
|
||||
link_methods = {
|
||||
"copy": self.copy,
|
||||
"symlink": self.symlink,
|
||||
"hardlink": self.hardlink,
|
||||
"reflink": self.reflink,
|
||||
}
|
||||
|
||||
i = len(link_types)
|
||||
while i > 0:
|
||||
link_method = link_methods[link_types[0]]
|
||||
link_method = getattr(self, link_types[0])
|
||||
try:
|
||||
self._do_link(from_info, to_info, link_method)
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user