empty-descriptions-and-dropped-worktrees #15

Merged
seb merged 10 commits from empty-descriptions-and-dropped-worktrees into main 2025-07-10 09:48:22 -06:00
Showing only changes of commit ca353352f8 - Show all commits

View file

@ -20,9 +20,24 @@ pub struct Worktree {
impl Drop for Worktree {
fn drop(&mut self) {
let _result = std::process::Command::new("git")
.args(["worktree", "remove", &self.path.path().to_string_lossy()])
let result = std::process::Command::new("git")
.args([
"worktree",
"remove",
"--force",
&self.path.path().to_string_lossy(),
])
.output();
match result {
Err(e) => {
println!("failed to run git: {:#?}", e);
}
Ok(result) => {
if !result.status.success() {
println!("failed to remove git worktree: {:#?}", result);
}
}
}
}
}