Skip to content

Worktrunk is a CLI for Git worktree management, designed for parallel AI agent workflows

Clarify worktree path exists error message

Maximilian Roosc766935c1db8
diff --git a/src/git/error.rs b/src/git/error.rs
index 1e54b37b8..c9947662f 100644
--- a/src/git/error.rs
+++ b/src/git/error.rs
@@ -267,7 +267,7 @@ impl std::fmt::Display for GitError {
"Directory already exists: <bold>{path_display}</>"
)),
hint_message(cformat!(
- "To remove manually, run <bright-black>rm -rf {path_escaped}</>; to retry with backup, run <bright-black>{switch_cmd}</>"
+ "To remove manually, run <bright-black>rm -rf {path_escaped}</>; to overwrite (with backup), run <bright-black>{switch_cmd}</>"
))
)
}
@@ -717,10 +717,10 @@ mod tests {
branch: "feature".to_string(),
path: PathBuf::from("/some/path"),
};
- assert_snapshot!(err.to_string(), @r"
+ assert_snapshot!(err.to_string(), @"
✗ Directory already exists: /some/path
- ↳ To remove manually, run rm -rf /some/path; to retry with backup, run wt switch feature --clobber
+ ↳ To remove manually, run rm -rf /some/path; to overwrite (with backup), run wt switch feature --clobber
");
}
diff --git a/tests/integration_tests/snapshots/integration__integration_tests__git_error_display__worktree_path_exists.snap b/tests/integration_tests/snapshots/integration__integration_tests__git_error_display__worktree_path_exists.snap
index 2f8d018e2..9fa8791d5 100644
--- a/tests/integration_tests/snapshots/integration__integration_tests__git_error_display__worktree_path_exists.snap
+++ b/tests/integration_tests/snapshots/integration__integration_tests__git_error_display__worktree_path_exists.snap
@@ -4,4 +4,4 @@ expression: err.to_string()
---
✗ Directory already exists: /tmp/repo.feature
-↳ To remove manually, run rm -rf /tmp/repo.feature; to retry with backup, run wt switch feature --clobber
+↳ To remove manually, run rm -rf /tmp/repo.feature; to overwrite (with backup), run wt switch feature --clobber
diff --git a/tests/snapshots/integration__integration_tests__switch__switch_error_path_occupied.snap b/tests/snapshots/integration__integration_tests__switch__switch_error_path_occupied.snap
index 3095aae31..19b099ac4 100644
--- a/tests/snapshots/integration__integration_tests__switch__switch_error_path_occupied.snap
+++ b/tests/snapshots/integration__integration_tests__switch__switch_error_path_occupied.snap
@@ -33,4 +33,4 @@ exit_code: 1
----- stderr -----
✗ Directory already exists: _REPO_.occupied-branch
-↳ To remove manually, run rm -rf _REPO_.occupied-branch; to retry with backup, run wt switch occupied-branch --clobber
+↳ To remove manually, run rm -rf _REPO_.occupied-branch; to overwrite (with backup), run wt switch occupied-branch --clobber