mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-02 07:18:25 +01:00
dvc: do not set cache dir if not a dvc repo (#3329)
This commit is contained in:
+1
-1
@@ -278,7 +278,7 @@ class Config(dict):
|
||||
self.update(conf)
|
||||
|
||||
# Add resolved default cache.dir
|
||||
if not self["cache"].get("dir"):
|
||||
if not self["cache"].get("dir") and self.dvc_dir:
|
||||
self["cache"]["dir"] = os.path.join(self.dvc_dir, "cache")
|
||||
|
||||
def load_one(self, level):
|
||||
|
||||
@@ -2,7 +2,7 @@ import pytest
|
||||
import configobj
|
||||
|
||||
from dvc.main import main
|
||||
from dvc.config import ConfigError
|
||||
from dvc.config import Config, ConfigError
|
||||
from tests.basic_env import TestDvc
|
||||
|
||||
|
||||
@@ -101,3 +101,8 @@ def test_merging_two_levels(dvc):
|
||||
"url": "ssh://example.com",
|
||||
"password": "1",
|
||||
}
|
||||
|
||||
|
||||
def test_config_loads_without_error_for_non_dvc_repo(tmp_dir):
|
||||
# regression testing for https://github.com/iterative/dvc/issues/3328
|
||||
Config(validate=True)
|
||||
|
||||
Reference in New Issue
Block a user