dvc: use realpath-ed paths consistently

Fixes #2127
This commit is contained in:
Ruslan Kuprieiev
2019-06-17 22:20:28 +03:00
parent 7890c85e1e
commit 459b7fad29
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -59,7 +59,7 @@ def init(root_dir=os.curdir, no_scm=False, force=False):
Raises:
KeyError: Raises an exception.
"""
root_dir = os.path.abspath(root_dir)
root_dir = os.path.realpath(root_dir)
dvc_dir = os.path.join(root_dir, Repo.DVC_DIR)
scm = SCM(root_dir)
if isinstance(scm, NoSCM) and not no_scm:
+2 -2
View File
@@ -42,10 +42,10 @@ class Git(Base):
from git.exc import InvalidGitRepositoryError
try:
self.git = git.Repo(root_dir)
self.git = git.Repo(self.root_dir)
except InvalidGitRepositoryError:
msg = "{} is not a git repository"
raise SCMError(msg.format(root_dir))
raise SCMError(msg.format(self.root_dir))
# NOTE: fixing LD_LIBRARY_PATH for binary built by PyInstaller.
# http://pyinstaller.readthedocs.io/en/stable/runtime-information.html