From 8871b923fa3df1935c263db155cb8bc3d59705cd Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sun, 10 May 2026 23:58:26 +0900 Subject: refactor(downloader): turn DownloadManager into downloader registry MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reshape DownloadManager from a hard-coded VCS match into a registry of DownloaderInterface instances keyed by source type, mirroring Composer's DownloadManager — with prefer-source/dist preferences, an IO handle, and a files cache. ArchiveManager now resolves dist sources through a shared DownloadManager instead of calling download_dist directly, and Composer::require / try_load take an IO so it flows through the factory wiring. --- crates/mozart-core/tests/git_driver_test.rs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'crates/mozart-core/tests/git_driver_test.rs') diff --git a/crates/mozart-core/tests/git_driver_test.rs b/crates/mozart-core/tests/git_driver_test.rs index 2b2db57..8d5ba1a 100644 --- a/crates/mozart-core/tests/git_driver_test.rs +++ b/crates/mozart-core/tests/git_driver_test.rs @@ -2,7 +2,6 @@ use mozart_core::downloader::{GitDownloader, VcsDownloader}; use mozart_core::repository::vcs::{DriverConfig, DriverType, create_driver, detect_driver}; use mozart_core::vcs::process::ProcessExecutor; use mozart_core::vcs::repository::VcsRepository; -use mozart_core::vcs::util::git::GitUtil; use std::path::Path; use std::process::Command; use tempfile::TempDir; @@ -148,9 +147,7 @@ fn test_git_downloader() { let install_dir = TempDir::new().unwrap(); create_test_repo(repo_dir.path()); - let process = ProcessExecutor::new(); - let git_util = GitUtil::new(process, cache_dir.path().join("git")); - let downloader = GitDownloader::new(git_util); + let downloader = GitDownloader::new(ProcessExecutor::new(), cache_dir.path().join("git")); let url = repo_dir.path().to_str().unwrap(); let target = install_dir.path().join("test-package"); @@ -203,9 +200,7 @@ fn test_git_downloader_unpushed_changes() { let install_dir = TempDir::new().unwrap(); create_test_repo(repo_dir.path()); - let process = ProcessExecutor::new(); - let git_util = GitUtil::new(process, cache_dir.path().join("git")); - let downloader = GitDownloader::new(git_util); + let downloader = GitDownloader::new(ProcessExecutor::new(), cache_dir.path().join("git")); let url = repo_dir.path().to_str().unwrap(); let target = install_dir.path().join("test-package"); -- cgit v1.3.1