aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/repository/vcs/hg_driver.rs
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-06-24 21:10:48 +0900
committernsfisis <nsfisis@gmail.com>2026-06-24 21:11:03 +0900
commita8f115666344abe3b606a4a65595ca301e7ac08a (patch)
tree9af244392d41542fae74ceab1be0b8fb473bdd46 /crates/shirabe/src/repository/vcs/hg_driver.rs
parent6dcc2125974e350d1844c5ce1bb3562e224f3435 (diff)
downloadphp-shirabe-a8f115666344abe3b606a4a65595ca301e7ac08a.tar.gz
php-shirabe-a8f115666344abe3b606a4a65595ca301e7ac08a.tar.zst
php-shirabe-a8f115666344abe3b606a4a65595ca301e7ac08a.zip
refactor(process): take cwd as Option<&str> instead of IntoExecCwd
Replace the generic cwd parameter backed by the IntoExecCwd trait with a concrete Option<&str> across execute/execute_args/execute_tty/execute_async. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/src/repository/vcs/hg_driver.rs')
-rw-r--r--crates/shirabe/src/repository/vcs/hg_driver.rs27
1 files changed, 13 insertions, 14 deletions
diff --git a/crates/shirabe/src/repository/vcs/hg_driver.rs b/crates/shirabe/src/repository/vcs/hg_driver.rs
index 737443c..3ae87d1 100644
--- a/crates/shirabe/src/repository/vcs/hg_driver.rs
+++ b/crates/shirabe/src/repository/vcs/hg_driver.rs
@@ -93,13 +93,13 @@ impl HgDriver {
&& self.inner.process.borrow_mut().execute_args(
["hg", "summary"].map(|s| s.to_string()).as_ref(),
&mut String::new(),
- Some(self.repo_dir.clone()),
+ Some(&self.repo_dir),
) == 0
{
if self.inner.process.borrow_mut().execute_args(
["hg", "pull"].map(|s| s.to_string()).as_ref(),
&mut String::new(),
- Some(self.repo_dir.clone()),
+ Some(&self.repo_dir),
) != 0
{
self.inner.io.write_error3(&format!("<error>Failed to update {}, package information from this repository may be outdated ({})</error>", self.inner.url, self.inner.process.borrow().get_error_output()), true, crate::io::NORMAL);
@@ -138,7 +138,7 @@ impl HgDriver {
.map(|s| s.to_string())
.as_ref(),
&mut output,
- Some(self.repo_dir.clone()),
+ Some(&self.repo_dir),
);
let lines = self.inner.process.borrow().split_lines(&output);
self.root_identifier = lines.into_iter().next();
@@ -184,11 +184,10 @@ impl HgDriver {
file.to_string(),
];
let mut content = String::new();
- self.inner.process.borrow_mut().execute_args(
- &resource,
- &mut content,
- Some(self.repo_dir.clone()),
- );
+ self.inner
+ .process
+ .borrow_mut()
+ .execute_args(&resource, &mut content, Some(&self.repo_dir));
if content.trim().is_empty() {
return Ok(None);
@@ -225,7 +224,7 @@ impl HgDriver {
.map(|s| s.to_string())
.as_ref(),
&mut output,
- Some(self.repo_dir.clone()),
+ Some(&self.repo_dir),
);
let date: DateTime<Utc> = shirabe_php_shim::date_create(output.trim())?;
@@ -239,7 +238,7 @@ impl HgDriver {
self.inner.process.borrow_mut().execute_args(
["hg", "tags"].map(|s| s.to_string()).as_ref(),
&mut output,
- Some(self.repo_dir.clone()),
+ Some(&self.repo_dir),
);
for tag in self.inner.process.borrow().split_lines(&output) {
if !tag.is_empty() {
@@ -269,7 +268,7 @@ impl HgDriver {
self.inner.process.borrow_mut().execute_args(
["hg", "branches"].map(|s| s.to_string()).as_ref(),
&mut output,
- Some(self.repo_dir.clone()),
+ Some(&self.repo_dir),
);
for branch in self.inner.process.borrow().split_lines(&output) {
if !branch.is_empty() {
@@ -290,7 +289,7 @@ impl HgDriver {
self.inner.process.borrow_mut().execute_args(
["hg", "bookmarks"].map(|s| s.to_string()).as_ref(),
&mut output,
- Some(self.repo_dir.clone()),
+ Some(&self.repo_dir),
);
for branch in self.inner.process.borrow().split_lines(&output) {
if !branch.is_empty() {
@@ -339,7 +338,7 @@ impl HgDriver {
if process.execute_args(
["hg", "summary"].map(|s| s.to_string()).as_ref(),
&mut output,
- Some(url),
+ Some(&url),
) == 0
{
return Ok(true);
@@ -357,7 +356,7 @@ impl HgDriver {
.map(|s| s.to_string())
.as_ref(),
&mut ignored,
- (),
+ None,
);
Ok(exit == 0)