diff options
Diffstat (limited to 'crates/shirabe/src/repository/vcs/git_driver.rs')
| -rw-r--r-- | crates/shirabe/src/repository/vcs/git_driver.rs | 107 |
1 files changed, 65 insertions, 42 deletions
diff --git a/crates/shirabe/src/repository/vcs/git_driver.rs b/crates/shirabe/src/repository/vcs/git_driver.rs index 01aa759..4878ffe 100644 --- a/crates/shirabe/src/repository/vcs/git_driver.rs +++ b/crates/shirabe/src/repository/vcs/git_driver.rs @@ -12,6 +12,7 @@ use shirabe_php_shim::{ use crate::cache::Cache; use crate::config::Config; +use crate::downloader::TransportException; use crate::io::IOInterface; use crate::io::IOInterfaceImmutable; use crate::repository::vcs::VcsDriverBase; @@ -19,6 +20,7 @@ use crate::util::Filesystem; use crate::util::Git as GitUtil; use crate::util::ProcessExecutor; use crate::util::Url; +use shirabe_php_shim::PhpMixed; #[derive(Debug)] pub struct GitDriver { @@ -401,7 +403,7 @@ impl GitDriver { pub fn supports( io: std::rc::Rc<std::cell::RefCell<dyn IOInterface>>, - _config: &Config, + config: std::rc::Rc<std::cell::RefCell<Config>>, url: &str, deep: bool, ) -> anyhow::Result<bool> { @@ -446,22 +448,15 @@ impl GitDriver { let process = std::rc::Rc::new(std::cell::RefCell::new(ProcessExecutor::new(Some( io.clone(), )))); - // TODO(phase-b): supports() takes &Config; GitUtil now needs Rc<RefCell<Config>>. - // Skipping clean Rc construction since we cannot reconstruct one from a borrowed &Config. - let _ = _config; - return Err(anyhow::anyhow!( - "GitDriver::supports requires Rc<RefCell<Config>>: not yet ported" - )); - #[allow(unreachable_code)] let mut git_util = GitUtil::new( io.clone(), - todo!(), + config.clone(), process.clone(), std::rc::Rc::new(std::cell::RefCell::new(Filesystem::new(None))), ); GitUtil::clean_env(&process); - let result = git_util.run_commands( + match git_util.run_commands( vec