From 610e43a0ab95b87bb293834f12c920fb39de2a1e Mon Sep 17 00:00:00 2001 From: Mayur Kularni Date: Sun, 8 Dec 2019 18:48:20 +0530 Subject: [PATCH] removed original repo ops --- dvc/external_repo.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/dvc/external_repo.py b/dvc/external_repo.py index abe4c6d04..b85baa927 100644 --- a/dvc/external_repo.py +++ b/dvc/external_repo.py @@ -71,18 +71,17 @@ def _external_repo(url=None, rev=None, cache_dir=None): try: # check if the URL is local and no default remote # add default remote pointing to the original repo's cache location - if not os.path.isdir(url): - # Adjust original repo for pointing remote towards its' cache - original_repo = Repo(url) - rconfig = RemoteConfig(original_repo.config) + if os.path.isdir(url): + rconfig = RemoteConfig(repo.config) if not _remote_config_exists(rconfig): rconfig.add( "upstream", - original_repo.cache.local.cache_dir, + repo.cache.local.cache_dir, default=True, + level=Config.LEVEL_LOCAL, ) - original_repo.scm.add([original_repo.config.config_file]) - original_repo.scm.commit("add remote") + repo.scm.add([repo.config.config_file]) + repo.scm.commit("add remote") if cache_dir is not None: cache_config = CacheConfig(repo.config)