diff --git a/dvc/repo/get.py b/dvc/repo/get.py index 534047504..7fbe6a5d7 100644 --- a/dvc/repo/get.py +++ b/dvc/repo/get.py @@ -78,7 +78,8 @@ def get(url, path, out=None, rev=None): is_not_cached = output and not output.use_cache if is_git_file or is_not_cached: - return _copy_git_file(repo, path, out, url) + _copy_git_file(repo, path, out, url) + return if output_error: raise OutputNotFoundError(path) diff --git a/tests/func/test_get.py b/tests/func/test_get.py index c7147447e..11f70ecc3 100644 --- a/tests/func/test_get.py +++ b/tests/func/test_get.py @@ -151,12 +151,8 @@ def test_fails_with_files_outside_repo(erepo): def test_fails_with_non_existing_files(erepo): - fname = "file_does_not_exist" - err = "The path '{}' does not exist in the target repository '{}'".format( - fname, erepo.root_dir - ) - with pytest.raises(PathOutsideRepoError, match=err): - Repo.get(erepo.root_dir, fname) + with pytest.raises(PathOutsideRepoError): + Repo.get(erepo.root_dir, "file_does_not_exist") @pytest.mark.parametrize("dname", [".", "dir", "dir/subdir"])