diff --git a/src/borg/helpers/fs.py b/src/borg/helpers/fs.py index 7e2e5efe2..7b402802c 100644 --- a/src/borg/helpers/fs.py +++ b/src/borg/helpers/fs.py @@ -130,7 +130,7 @@ def get_cache_dir(*, legacy=False): return cache_dir -def get_config_dir(*, legacy=True): +def get_config_dir(*, legacy=False): """Determine where to store whole config""" # Get config home path diff --git a/src/borg/testsuite/helpers.py b/src/borg/testsuite/helpers.py index a1ae9c51c..b6ddd58ee 100644 --- a/src/borg/testsuite/helpers.py +++ b/src/borg/testsuite/helpers.py @@ -614,7 +614,12 @@ def test_get_config_dir(monkeypatch): monkeypatch.delenv("BORG_BASE_DIR", raising=False) if is_win32: monkeypatch.delenv("BORG_CONFIG_DIR", raising=False) - assert get_config_dir(legacy=False) == os.path.join(os.path.expanduser("~"), "AppData", "Local", "borg", "borg") + assert get_config_dir() == os.path.join(os.path.expanduser("~"), "AppData", "Local", "borg", "borg") + elif is_darwin: + monkeypatch.delenv("BORG_CONFIG_DIR", raising=False) + assert get_config_dir() == os.path.join(os.path.expanduser("~"), "Library", "Preferences", "borg") + monkeypatch.setenv("BORG_CONFIG_DIR", "/var/tmp") + assert get_config_dir() == "/var/tmp" else: monkeypatch.delenv("XDG_CONFIG_HOME", raising=False) monkeypatch.delenv("BORG_CONFIG_DIR", raising=False)