aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/repository/vcs/git_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/git_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/git_driver.rs')
-rw-r--r--crates/shirabe/src/repository/vcs/git_driver.rs19
1 files changed, 9 insertions, 10 deletions
diff --git a/crates/shirabe/src/repository/vcs/git_driver.rs b/crates/shirabe/src/repository/vcs/git_driver.rs
index e639649..37f393c 100644
--- a/crates/shirabe/src/repository/vcs/git_driver.rs
+++ b/crates/shirabe/src/repository/vcs/git_driver.rs
@@ -208,7 +208,7 @@ impl GitDriver {
"--no-color".to_string(),
],
&mut output,
- Some(self.repo_dir.clone()),
+ Some(&self.repo_dir),
);
let branches = self.inner.process.borrow().split_lines(&output);
if !branches.contains(&"* master".to_string()) {
@@ -269,7 +269,7 @@ impl GitDriver {
format!("{}:{}", identifier, file),
],
&mut content,
- Some(self.repo_dir.clone()),
+ Some(&self.repo_dir),
);
if content.trim().is_empty() {
@@ -303,11 +303,10 @@ impl GitDriver {
],
);
let mut output = String::new();
- self.inner.process.borrow_mut().execute_args(
- &command,
- &mut output,
- Some(self.repo_dir.clone()),
- );
+ self.inner
+ .process
+ .borrow_mut()
+ .execute_args(&command, &mut output, Some(&self.repo_dir));
let timestamp_str = GitUtil::parse_rev_list_output(&output, &self.inner.process);
let timestamp: i64 = timestamp_str.trim().parse().unwrap_or(0);
@@ -329,7 +328,7 @@ impl GitDriver {
"--dereference".to_string(),
],
&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() {
@@ -368,7 +367,7 @@ impl GitDriver {
"-v".to_string(),
],
&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() && !Preg::is_match(r"{^ *[^/]+/HEAD }", &branch) {
@@ -419,7 +418,7 @@ impl GitDriver {
if process.borrow_mut().execute_args(
&["git".to_string(), "tag".to_string()],
&mut output,
- Some(url.clone()),
+ Some(&url),
) == 0
{
return Ok(true);