We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0e2ef47 commit 9f279b3Copy full SHA for 9f279b3
dvc/repo/get.py
@@ -27,6 +27,11 @@ def __init__(self):
27
)
28
29
30
+def _forbid_absolute_path(path):
31
+ if os.path.isabs(path):
32
+ raise FileNotFoundError
33
+
34
35
@staticmethod
36
def get(url, path, out=None, rev=None):
37
out = resolve_output(path, out)
@@ -66,8 +71,7 @@ def get(url, path, out=None, rev=None):
66
71
return
67
72
68
73
# Either an uncached out with absolute path or a user error
69
- if os.path.isabs(path):
70
- raise FileNotFoundError
74
+ _forbid_absolute_path(path)
75
76
fs_copy(os.path.join(repo.root_dir, path), out)
77
@@ -76,6 +80,7 @@ def get(url, path, out=None, rev=None):
80
# Not a DVC repository, continue below and copy from git
81
pass
78
82
83
79
84
raw_git_dir = cached_clone(url, rev=rev)
85
fs_copy(os.path.join(raw_git_dir, path), out)
86
except (OutputNotFoundError, FileNotFoundError):
0 commit comments