aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/repository/vcs/fossil_driver.rs
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-05-26 20:04:02 +0900
committernsfisis <nsfisis@gmail.com>2026-05-26 20:04:02 +0900
commitf411daceacad66e0bd774fda7d3c5ef8533cc55c (patch)
treeeefb065e4d676a3f7031ca49bab21c773b00b134 /crates/shirabe/src/repository/vcs/fossil_driver.rs
parent1921f173ea219cb4b25847294d2d3fa465550fbb (diff)
downloadphp-shirabe-f411daceacad66e0bd774fda7d3c5ef8533cc55c.tar.gz
php-shirabe-f411daceacad66e0bd774fda7d3c5ef8533cc55c.tar.zst
php-shirabe-f411daceacad66e0bd774fda7d3c5ef8533cc55c.zip
refactor(io): share IOInterface via Rc<RefCell<dyn _>> handle
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/src/repository/vcs/fossil_driver.rs')
-rw-r--r--crates/shirabe/src/repository/vcs/fossil_driver.rs12
1 files changed, 9 insertions, 3 deletions
diff --git a/crates/shirabe/src/repository/vcs/fossil_driver.rs b/crates/shirabe/src/repository/vcs/fossil_driver.rs
index 4982d17..207a138 100644
--- a/crates/shirabe/src/repository/vcs/fossil_driver.rs
+++ b/crates/shirabe/src/repository/vcs/fossil_driver.rs
@@ -9,6 +9,7 @@ use shirabe_php_shim::{PhpMixed, RuntimeException, dirname, is_dir, is_file, is_
use crate::cache::Cache;
use crate::config::Config;
use crate::io::IOInterface;
+use crate::io::IOInterfaceImmutable;
use crate::repository::vcs::VcsDriverBase;
use crate::util::Filesystem;
use crate::util::ProcessExecutor;
@@ -31,7 +32,7 @@ impl FossilDriver {
// Ensure we are allowed to use this URL by config.
self.inner.config.borrow_mut().prohibit_url_by_config(
&self.inner.url,
- Some(&*self.inner.io),
+ Some(&*self.inner.io.borrow()),
&indexmap::IndexMap::new(),
)?;
@@ -289,7 +290,12 @@ impl FossilDriver {
Ok(self.branches.clone().unwrap_or_default())
}
- pub fn supports(io: &dyn IOInterface, config: &Config, url: &str, deep: bool) -> bool {
+ pub fn supports(
+ io: std::rc::Rc<std::cell::RefCell<dyn IOInterface>>,
+ config: &Config,
+ url: &str,
+ deep: bool,
+ ) -> bool {
if Preg::is_match(
r"#(^(?:https?|ssh)://(?:[^@]@)?(?:chiselapp\.com|fossil\.))#i",
url,
@@ -310,7 +316,7 @@ impl FossilDriver {
return false;
}
- let mut process = ProcessExecutor::new(io);
+ let mut process = ProcessExecutor::new(Some(io));
let mut output = String::new();
if process.execute_args(
&["fossil", "info"].map(|s| s.to_string()).to_vec(),