From 283ef7d1f4d85812dccd3b7e05441cfc05c59b4c Mon Sep 17 00:00:00 2001 From: nsfisis Date: Tue, 5 May 2026 13:17:15 +0900 Subject: feat(vcs): wire cache-vcs-dir setting through to drivers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit DriverConfig used to expose a generic cache_dir hardcoded to a relative ".cache/mozart/vcs", with each driver appending its own "git"/"hg" subdir. As a result, the cache-vcs-dir setting (and COMPOSER_CACHE_VCS_DIR env var) had no effect on where mirrors were actually stored. Replace cache_dir with cache_vcs_dir, resolving its default the same way Composer does (COMPOSER_CACHE_VCS_DIR → COMPOSER_CACHE_DIR/vcs → XDG/HOME fallbacks), and have GitDriver/HgDriver use it directly. This brings the Mozart cache layout in line with Composer's: a single shared vcs root with one subdirectory per sanitized URL. --- crates/mozart-vcs/src/driver/hg.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'crates/mozart-vcs/src/driver/hg.rs') diff --git a/crates/mozart-vcs/src/driver/hg.rs b/crates/mozart-vcs/src/driver/hg.rs index 0782775..f476e6a 100644 --- a/crates/mozart-vcs/src/driver/hg.rs +++ b/crates/mozart-vcs/src/driver/hg.rs @@ -51,8 +51,8 @@ impl HgDriver { impl VcsDriver for HgDriver { async fn initialize(&mut self) -> Result<()> { - let cache_dir = self.config.cache_dir.join("hg"); - std::fs::create_dir_all(&cache_dir)?; + let cache_dir = &self.config.cache_vcs_dir; + std::fs::create_dir_all(cache_dir)?; let repo_dir = cache_dir.join(crate::util::git::GitUtil::sanitize_url(&self.url)); if repo_dir.join(".hg").is_dir() { -- cgit v1.3.1