Skip to content

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

Refactor: Simplify `format_with_gutter` and `format_toml`

Maximilian Roos47a1525b5016
diff --git a/CLAUDE.md b/CLAUDE.md
index d7c4582aa..e1bb609a3 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -249,7 +249,7 @@ The gutter's visual distinction is sufficient - no additional indentation requir
#### Formatting Rules
-1. **Always use empty left margin**: `format_with_gutter(content, "")`
+1. **Gutter at column 0**: `format_with_gutter(content)`
- Gutter appears at column 0
- Content appears at column 1 (after the gutter + 1 space)
- The colored background provides visual separation from surrounding text
@@ -284,22 +284,19 @@ project wants to execute:
#### Implementation
-**Always use empty left margin:**
-
```rust
use worktrunk::styling::format_with_gutter;
-// All contexts - no indentation needed
-print!("{}", format_with_gutter(&command, ""));
-print!("{}", format_with_gutter(&config, ""));
+// Simple usage - gutter provides all separation
+print!("{}", format_with_gutter(&command));
+print!("{}", format_with_gutter(&config));
```
**Function signature:**
```rust
/// Arguments:
/// - content: Text to format (preserves internal structure for multi-line)
-/// - left_margin: Should always be "" (kept as parameter for API consistency)
-pub fn format_with_gutter(content: &str, left_margin: &str) -> String
+pub fn format_with_gutter(content: &str) -> String
```
## Testing Guidelines
diff --git a/src/commands/command_approval.rs b/src/commands/command_approval.rs
index e4afb1047..c656cf69d 100644
--- a/src/commands/command_approval.rs
+++ b/src/commands/command_approval.rs
@@ -118,7 +118,7 @@ fn prompt_for_approval(command: &str, project_id: &str) -> std::io::Result<bool>
eprintln!("{WARNING_EMOJI} {WARNING}Permission required to execute in worktree{WARNING:#}");
eprintln!();
eprintln!("{bold}{project_name}{bold:#} ({dim}{project_id}{dim:#}) wants to execute:");
- eprint!("{}", format_with_gutter(command, "")); // Gutter at column 0, provides visual separation
+ eprint!("{}", format_with_gutter(command));
eprintln!();
eprint!("{HINT_EMOJI} Allow and remember? {bold}[y/N]{bold:#} ");
io::stderr().flush()?;
diff --git a/src/commands/config.rs b/src/commands/config.rs
index 66e00e8dc..06c3ffb63 100644
--- a/src/commands/config.rs
+++ b/src/commands/config.rs
@@ -91,8 +91,8 @@ fn display_global_config() -> Result<(), GitError> {
return Ok(());
}
- // Display TOML with syntax highlighting (gutter at column 0)
- print!("{}", format_toml(&contents, ""));
+ // Display TOML with syntax highlighting
+ print!("{}", format_toml(&contents));
Ok(())
}
@@ -129,8 +129,8 @@ fn display_project_config() -> Result<(), GitError> {
return Ok(());
}
- // Display TOML with syntax highlighting (gutter at column 0)
- print!("{}", format_toml(&contents, ""));
+ // Display TOML with syntax highlighting
+ print!("{}", format_toml(&contents));
Ok(())
}
diff --git a/src/commands/merge.rs b/src/commands/merge.rs
index e5cd4a60d..bf2ac4e6d 100644
--- a/src/commands/merge.rs
+++ b/src/commands/merge.rs
@@ -1,6 +1,5 @@
use anstyle::{AnsiColor, Color};
-use std::collections::HashMap;
-use worktrunk::config::{ProjectConfig, WorktrunkConfig, expand_template};
+use worktrunk::config::{ProjectConfig, WorktrunkConfig, expand_command_template};
use worktrunk::git::{GitError, Repository};
use worktrunk::styling::{AnstyleStyle, ERROR, ERROR_EMOJI, HINT, HINT_EMOJI, eprintln, println};
@@ -369,9 +368,9 @@ fn run_pre_merge_checks(
&command,
repo_name,
current_branch,
- target_branch,
worktree_path,
&repo_root,
+ Some(target_branch),
);
if !internal {
@@ -397,20 +396,3 @@ fn run_pre_merge_checks(
Ok(())
}
-
-/// Expand template variables in a command, including {target}
-fn expand_command_template(
- command: &str,
- repo_name: &str,
- branch: &str,
- target_branch: &str,
- worktree_path: &std::path::Path,
- repo_root: &std::path::Path,
-) -> String {
- let mut extra = HashMap::new();
- extra.insert("worktree", worktree_path.to_str().unwrap_or(""));
- extra.insert("repo_root", repo_root.to_str().unwrap_or(""));
- extra.insert("target", target_branch);
-
- expand_template(command, repo_name, branch, &extra)
-}
diff --git a/src/commands/worktree.rs b/src/commands/worktree.rs
index 5f24a3341..ef8d61b05 100644
--- a/src/commands/worktree.rs
+++ b/src/commands/worktree.rs
@@ -100,9 +100,8 @@
//!
//! See also: DEMO.md for detailed architecture explanation.
-use std::collections::HashMap;
use std::path::PathBuf;
-use worktrunk::config::{ProjectConfig, WorktrunkConfig, expand_template};
+use worktrunk::config::{ProjectConfig, WorktrunkConfig, expand_command_template};
use worktrunk::git::{GitError, Repository};
use worktrunk::styling::{
AnstyleStyle, ERROR, ERROR_EMOJI, HINT, HINT_EMOJI, WARNING, WARNING_EMOJI, eprint, eprintln,
@@ -172,9 +171,7 @@ pub fn handle_switch(
// Check if worktree already exists for this branch
match repo.worktree_for_branch(branch)? {
Some(existing_path) if existing_path.exists() => {
- // Canonicalize the path for cleaner display
- let canonical_existing_path = existing_path.canonicalize().unwrap_or(existing_path);
- return Ok(SwitchResult::ExistingWorktree(canonical_existing_path));
+ return Ok(SwitchResult::ExistingWorktree(existing_path));
}
Some(_) => {
let error_bold = ERROR.bold();
@@ -215,23 +212,18 @@ pub fn handle_switch(
repo.run_command(&args)
.map_err(|e| GitError::CommandFailed(format!("Failed to create worktree: {}", e)))?;
- // Canonicalize the path for cleaner display
- let canonical_path = worktree_path
- .canonicalize()
- .unwrap_or_else(|_| worktree_path.clone());
-
// Execute post-create commands (sequential, blocking)
if !no_config_commands {
- execute_post_create_commands(&canonical_path, &repo, config, branch, repo_name, force)?;
+ execute_post_create_commands(&worktree_path, &repo, config, branch, repo_name, force)?;
}
// Spawn post-start commands (parallel, background)
if !no_config_commands {
- spawn_post_start_commands(&canonical_path, &repo, config, branch, repo_name, force)?;
+ spawn_post_start_commands(&worktree_path, &repo, config, branch, repo_name, force)?;
}
Ok(SwitchResult::CreatedWorktree {
- path: canonical_path,
+ path: worktree_path,
created_branch: create,
})
}
@@ -266,13 +258,8 @@ pub fn handle_remove() -> Result<RemoveResult, GitError> {
);
}
- // Canonicalize the path for cleaner display
- let canonical_primary_path = primary_worktree_dir
- .canonicalize()
- .unwrap_or(primary_worktree_dir);
-
Ok(RemoveResult::RemovedWorktree {
- primary_path: canonical_primary_path,
+ primary_path: primary_worktree_dir,
})
} else {
// In main repo but not on default branch: switch to default
@@ -340,47 +327,6 @@ fn check_worktree_conflicts(
Ok(())
}
-/// Replace template variables in a command string
-///
-/// Supported variables:
-/// - `{repo}` - Repository name
-/// - `{branch}` - Branch name (sanitized)
-/// - `{worktree}` - Path to the new worktree
-/// - `{repo_root}` - Path to the main repository root
-fn expand_command_template(
- command: &str,
- repo_name: &str,
- branch: &str,
- worktree_path: &std::path::Path,
- repo_root: &std::path::Path,
-) -> String {
- let mut extra = HashMap::new();
- extra.insert("worktree", worktree_path.to_str().unwrap_or(""));
- extra.insert("repo_root", repo_root.to_str().unwrap_or(""));
-
- expand_template(command, repo_name, branch, &extra)
-}
-
-/// Helper to load project config with error handling
-fn load_project_config(repo: &Repository) -> Result<Option<ProjectConfig>, GitError> {
- let repo_root = repo.worktree_root()?;
- let config_path = repo_root.join(".config").join("wt.toml");
- match ProjectConfig::load(&repo_root) {
- Ok(cfg) => Ok(cfg),
- Err(e) => {
- eprintln!(
- "{WARNING_EMOJI} {WARNING}Failed to load project config from {}{WARNING:#}",
- config_path.display()
- );
- eprintln!("{HINT_EMOJI} {HINT}Error details: {e}{HINT:#}");
- eprintln!(
- "{HINT_EMOJI} {HINT}Skipping commands. Check TOML syntax if file exists.{HINT:#}"
- );
- Ok(None)
- }
- }
-}
-
/// Execute post-create commands sequentially (blocking)
fn execute_post_create_commands(
worktree_path: &std::path::Path,
@@ -390,7 +336,10 @@ fn execute_post_create_commands(
repo_name: &str,
force: bool,
) -> Result<(), GitError> {
- let project_config = match load_project_config(repo)? {
+ let repo_root = repo.worktree_root()?;
+ let project_config = match ProjectConfig::load(&repo_root)
+ .map_err(|e| GitError::CommandFailed(format!("Failed to load project config: {}", e)))?
+ {
Some(cfg) => cfg,
None => return Ok(()),
};
@@ -416,13 +365,13 @@ fn execute_post_create_commands(
}
let expanded_command =
- expand_command_template(&command, repo_name, branch, worktree_path, &repo_root);
+ expand_command_template(&command, repo_name, branch, worktree_path, &repo_root, None);
use anstyle::{AnsiColor, Color};
use std::io::Write;
let cyan = AnstyleStyle::new().fg_color(Some(Color::Ansi(AnsiColor::Cyan)));
eprintln!("πŸ”„ {cyan}Executing (post-create):{cyan:#}");
- eprint!("{}", format_with_gutter(&expanded_command, "")); // Gutter at column 0
+ eprint!("{}", format_with_gutter(&expanded_command));
let _ = std::io::stderr().flush();
if let Err(e) = execute_command_in_worktree(worktree_path, &expanded_command) {
@@ -450,7 +399,10 @@ fn spawn_post_start_commands(
repo_name: &str,
force: bool,
) -> Result<(), GitError> {
- let project_config = match load_project_config(repo)? {
+ let repo_root = repo.worktree_root()?;
+ let project_config = match ProjectConfig::load(&repo_root)
+ .map_err(|e| GitError::CommandFailed(format!("Failed to load project config: {}", e)))?
+ {
Some(cfg) => cfg,
None => return Ok(()),
};
@@ -476,7 +428,7 @@ fn spawn_post_start_commands(
}
let expanded_command =
- expand_command_template(&command, repo_name, branch, worktree_path, &repo_root);
+ expand_command_template(&command, repo_name, branch, worktree_path, &repo_root, None);
use anstyle::{AnsiColor, Color};
use std::io::Write;
@@ -634,20 +586,20 @@ pub fn handle_push(
if commit_count == 1 { "" } else { "s" }
)];
- if let Some(files) = stats.files {
+ if stats.files > 0 {
summary_parts.push(format!(
"{} file{}",
- files,
- if files == 1 { "" } else { "s" }
+ stats.files,
+ if stats.files == 1 { "" } else { "s" }
));
}
- if let Some(insertions) = stats.insertions {
+ if stats.insertions > 0 {
let addition = AnstyleStyle::new().fg_color(Some(Color::Ansi(AnsiColor::Green)));
- summary_parts.push(format!("{addition}+{insertions}{addition:#}"));
+ summary_parts.push(format!("{addition}+{}{addition:#}", stats.insertions));
}
- if let Some(deletions) = stats.deletions {
+ if stats.deletions > 0 {
let deletion = AnstyleStyle::new().fg_color(Some(Color::Ansi(AnsiColor::Red)));
- summary_parts.push(format!("{deletion}-{deletions}{deletion:#}"));
+ summary_parts.push(format!("{deletion}-{}{deletion:#}", stats.deletions));
}
println!(
@@ -664,36 +616,33 @@ pub fn handle_push(
/// Parse git diff --shortstat output
struct DiffStats {
- files: Option<usize>,
- insertions: Option<usize>,
- deletions: Option<usize>,
+ files: usize,
+ insertions: usize,
+ deletions: usize,
}
fn parse_diff_shortstat(output: &str) -> DiffStats {
let mut stats = DiffStats {
- files: None,
- insertions: None,
- deletions: None,
+ files: 0,
+ insertions: 0,
+ deletions: 0,
};
// Example: " 3 files changed, 45 insertions(+), 12 deletions(-)"
- let parts: Vec<&str> = output.split(',').collect();
-
- for part in parts {
- let part = part.trim();
+ for part in output.split(',') {
+ let tokens: Vec<&str> = part.trim().split_whitespace().collect();
+ if tokens.len() < 2 {
+ continue;
+ }
- if part.contains("file") {
- if let Some(num_str) = part.split_whitespace().next() {
- stats.files = num_str.parse().ok();
- }
- } else if part.contains("insertion") {
- if let Some(num_str) = part.split_whitespace().next() {
- stats.insertions = num_str.parse().ok();
+ if let Ok(n) = tokens[0].parse::<usize>() {
+ if tokens[1].starts_with("file") {
+ stats.files = n;
+ } else if tokens[1].starts_with("insertion") {
+ stats.insertions = n;
+ } else if tokens[1].starts_with("deletion") {
+ stats.deletions = n;
}
- } else if part.contains("deletion")
- && let Some(num_str) = part.split_whitespace().next()
- {
- stats.deletions = num_str.parse().ok();
}
}
diff --git a/src/config.rs b/src/config.rs
index 5f0c879e0..a8174eb1f 100644
--- a/src/config.rs
+++ b/src/config.rs
@@ -157,7 +157,17 @@ impl WorktrunkConfig {
builder = builder.add_source(config::Environment::with_prefix("WORKTRUNK").separator("_"));
let config: Self = builder.build()?.try_deserialize()?;
- validate_worktree_path(&config.worktree_path)?;
+
+ // Validate worktree path
+ if config.worktree_path.is_empty() {
+ return Err(ConfigError::Message("worktree-path cannot be empty".into()));
+ }
+ if std::path::Path::new(&config.worktree_path).is_absolute() {
+ return Err(ConfigError::Message(
+ "worktree-path must be relative, not absolute".into(),
+ ));
+ }
+
Ok(config)
}
@@ -231,6 +241,49 @@ pub fn expand_template(
result
}
+/// Expand command template variables
+///
+/// Convenience function for expanding command templates with common variables.
+///
+/// Supported variables:
+/// - `{repo}` - Repository name
+/// - `{branch}` - Branch name (sanitized)
+/// - `{worktree}` - Path to the worktree
+/// - `{repo_root}` - Path to the main repository root
+/// - `{target}` - Target branch (for merge commands, optional)
+///
+/// # Examples
+/// ```
+/// use worktrunk::config::expand_command_template;
+/// use std::path::Path;
+///
+/// let cmd = expand_command_template(
+/// "cp {repo_root}/target {worktree}/target",
+/// "myrepo",
+/// "feature",
+/// Path::new("/path/to/worktree"),
+/// Path::new("/path/to/repo"),
+/// None,
+/// );
+/// ```
+pub fn expand_command_template(
+ command: &str,
+ repo_name: &str,
+ branch: &str,
+ worktree_path: &std::path::Path,
+ repo_root: &std::path::Path,
+ target_branch: Option<&str>,
+) -> String {
+ let mut extra = std::collections::HashMap::new();
+ extra.insert("worktree", worktree_path.to_str().unwrap_or(""));
+ extra.insert("repo_root", repo_root.to_str().unwrap_or(""));
+ if let Some(target) = target_branch {
+ extra.insert("target", target);
+ }
+
+ expand_template(command, repo_name, branch, &extra)
+}
+
impl ProjectConfig {
/// Load project configuration from .config/wt.toml in the repository root
pub fn load(repo_root: &std::path::Path) -> Result<Option<Self>, ConfigError> {
@@ -344,24 +397,6 @@ impl WorktrunkConfig {
}
}
-fn validate_worktree_path(template: &str) -> Result<(), ConfigError> {
- if template.is_empty() {
- return Err(ConfigError::Message(
- "worktree-path cannot be empty".to_string(),
- ));
- }
-
- // Reject absolute paths
- let path = std::path::Path::new(template);
- if path.is_absolute() {
- return Err(ConfigError::Message(
- "worktree-path must be relative, not absolute".to_string(),
- ));
- }
-
- Ok(())
-}
-
#[cfg(test)]
mod tests {
use super::*;
@@ -468,36 +503,6 @@ mod tests {
);
}
- #[test]
- fn test_validate_rejects_empty_path() {
- let result = validate_worktree_path("");
- assert!(result.is_err());
- assert!(result.unwrap_err().to_string().contains("cannot be empty"));
- }
-
- #[test]
- fn test_validate_rejects_absolute_path_unix() {
- let result = validate_worktree_path("/absolute/path/{branch}");
- assert!(result.is_err());
- assert!(result.unwrap_err().to_string().contains("must be relative"));
- }
-
- #[test]
- #[cfg(target_os = "windows")]
- fn test_validate_rejects_absolute_path_windows() {
- let result = validate_worktree_path("C:\\absolute\\path\\{branch}");
- assert!(result.is_err());
- assert!(result.unwrap_err().to_string().contains("must be relative"));
- }
-
- #[test]
- fn test_validate_accepts_relative_path() {
- assert!(validate_worktree_path(".worktrees/{main-worktree}/{branch}").is_ok());
- assert!(validate_worktree_path("../{main-worktree}.{branch}").is_ok());
- assert!(validate_worktree_path("../../shared/{main-worktree}/{branch}").is_ok());
- assert!(validate_worktree_path(".worktrees/{branch}").is_ok());
- }
-
#[test]
fn test_project_config_default() {
let config = ProjectConfig::default();
diff --git a/src/git.rs b/src/git.rs
index c820d052e..33c6c0b83 100644
--- a/src/git.rs
+++ b/src/git.rs
@@ -954,26 +954,4 @@ abcd1234567890abcd1234567890abcd12345678\tHEAD
let branch = parse_remote_default_branch(output).unwrap();
assert_eq!(branch, "feature/new-ui");
}
-
- #[test]
- fn test_get_current_branch_parse() {
- // Test parsing of branch --show-current output
- // We can't test the actual command without a git repo,
- // but we've verified the parsing logic through the implementation
- }
-
- #[test]
- fn test_worktree_for_branch_not_found() {
- // Test that worktree_for_branch returns None when no worktree exists
- // This would require a git repo, so we'll test this in integration tests
- }
-
- #[test]
- fn test_project_identifier_parsing() {
- // Test URL parsing logic (can't test actual git commands without a repo)
- // These would be unit tests if we extracted the URL parsing logic
-
- // The actual parsing is done inline in project_identifier(),
- // so we'll rely on integration tests for full coverage
- }
}
diff --git a/src/styling.rs b/src/styling.rs
index 57b1e5458..4ddecbc6c 100644
--- a/src/styling.rs
+++ b/src/styling.rs
@@ -39,22 +39,6 @@ pub use anstyle::Style as AnstyleStyle;
/// Error style (red) - use as `{ERROR}text{ERROR:#}`
pub const ERROR: Style = Style::new().fg_color(Some(Color::Ansi(AnsiColor::Red)));
-// ============================================================================
-// Message Emojis
-// ============================================================================
-
-/// Progress emoji - use with cyan style: `println!("{PROGRESS_EMOJI} {cyan}message{cyan:#}");`
-pub const PROGRESS_EMOJI: &str = "πŸ”„";
-
-/// Error emoji - use with ERROR style: `eprintln!("{ERROR_EMOJI} {ERROR}message{ERROR:#}");`
-pub const ERROR_EMOJI: &str = "❌";
-
-/// Warning emoji - use with WARNING style: `eprintln!("{WARNING_EMOJI} {WARNING}message{WARNING:#}");`
-pub const WARNING_EMOJI: &str = "🟑";
-
-/// Hint emoji - use with HINT style: `println!("{HINT_EMOJI} {HINT}message{HINT:#}");`
-pub const HINT_EMOJI: &str = "πŸ’‘";
-
/// Warning style (yellow) - use as `{WARNING}text{WARNING:#}`
pub const WARNING: Style = Style::new().fg_color(Some(Color::Ansi(AnsiColor::Yellow)));
@@ -72,6 +56,28 @@ pub const ADDITION: Style = Style::new().fg_color(Some(Color::Ansi(AnsiColor::Gr
/// Deletion style for diffs (red)
pub const DELETION: Style = Style::new().fg_color(Some(Color::Ansi(AnsiColor::Red)));
+/// Cyan style - use as `{CYAN}text{CYAN:#}`
+pub const CYAN: Style = Style::new().fg_color(Some(Color::Ansi(AnsiColor::Cyan)));
+
+/// Green style - use as `{GREEN}text{GREEN:#}`
+pub const GREEN: Style = Style::new().fg_color(Some(Color::Ansi(AnsiColor::Green)));
+
+// ============================================================================
+// Message Emojis
+// ============================================================================
+
+/// Progress emoji - use with cyan style: `println!("{PROGRESS_EMOJI} {cyan}message{cyan:#}");`
+pub const PROGRESS_EMOJI: &str = "πŸ”„";
+
+/// Error emoji - use with ERROR style: `eprintln!("{ERROR_EMOJI} {ERROR}message{ERROR:#}");`
+pub const ERROR_EMOJI: &str = "❌";
+
+/// Warning emoji - use with WARNING style: `eprintln!("{WARNING_EMOJI} {WARNING}message{WARNING:#}");`
+pub const WARNING_EMOJI: &str = "🟑";
+
+/// Hint emoji - use with HINT style: `println!("{HINT_EMOJI} {HINT}message{HINT:#}");`
+pub const HINT_EMOJI: &str = "πŸ’‘";
+
// ============================================================================
// Styled Output Types
// ============================================================================
@@ -169,22 +175,20 @@ impl StyledLine {
///
/// # Arguments
/// * `content` - The text to format (preserves internal structure for multi-line)
-/// * `left_margin` - Should always be "" (gutter provides all visual separation)
///
/// The gutter appears at column 0, followed by 1 space, then the content at column 1.
///
/// # Example
/// ```ignore
-/// // All contexts use empty left margin
-/// print!("{}", format_with_gutter(&config, ""));
-/// print!("{}", format_with_gutter(&command, ""));
+/// print!("{}", format_with_gutter(&config));
+/// print!("{}", format_with_gutter(&command));
/// ```
-pub fn format_with_gutter(content: &str, left_margin: &str) -> String {
+pub fn format_with_gutter(content: &str) -> String {
let gutter = Style::new().bg_color(Some(Color::Ansi(AnsiColor::Black)));
let mut output = String::new();
for line in content.lines() {
- output.push_str(&format!("{left_margin}{gutter} {gutter:#} {line}\n"));
+ output.push_str(&format!("{gutter} {gutter:#} {line}\n"));
}
output
@@ -195,7 +199,7 @@ pub fn format_with_gutter(content: &str, left_margin: &str) -> String {
// ============================================================================
/// Formats TOML content with syntax highlighting using synoptic
-pub fn format_toml(content: &str, left_margin: &str) -> String {
+pub fn format_toml(content: &str) -> String {
// Gutter style: subtle background for visual separation
let gutter = Style::new().bg_color(Some(Color::Ansi(AnsiColor::Black)));
@@ -207,9 +211,7 @@ pub fn format_toml(content: &str, left_margin: &str) -> String {
let dim = Style::new().dimmed();
let mut output = String::new();
for line in content.lines() {
- output.push_str(&format!(
- "{left_margin}{gutter} {gutter:#} {dim}{line}{dim:#}\n"
- ));
+ output.push_str(&format!("{gutter} {gutter:#} {dim}{line}{dim:#}\n"));
}
return output;
}
@@ -223,8 +225,8 @@ pub fn format_toml(content: &str, left_margin: &str) -> String {
// Render each line with appropriate styling
for (y, line) in lines.iter().enumerate() {
- // Add left margin, gutter, and spacing
- output.push_str(&format!("{left_margin}{gutter} {gutter:#} "));
+ // Add gutter and spacing
+ output.push_str(&format!("{gutter} {gutter:#} "));
// Render each token with appropriate styling
for token in highlighter.line(y, line) {
@@ -301,7 +303,7 @@ project = "github.com/user/repo"
command = "npm install"
"#;
- let output = format_toml(toml_content, "");
+ let output = format_toml(toml_content);
// Check that output contains ANSI escape codes
assert!(
diff --git a/tests/common/mod.rs b/tests/common/mod.rs
index d0780c208..585efb71b 100644
--- a/tests/common/mod.rs
+++ b/tests/common/mod.rs
@@ -39,7 +39,7 @@ impl TestRepo {
pub fn new() -> Self {
let temp_dir = TempDir::new().expect("Failed to create temp directory");
// Create main repo as a subdirectory so worktrees can be siblings
- let root = temp_dir.path().join("main");
+ let root = temp_dir.path().join("test-repo");
std::fs::create_dir(&root).expect("Failed to create main repo directory");
// Canonicalize to resolve symlinks (important on macOS where /var is symlink to /private/var)
let root = root
diff --git a/tests/integration_tests/e2e_shell.rs b/tests/integration_tests/e2e_shell.rs
index 828376708..7bc64b100 100644
--- a/tests/integration_tests/e2e_shell.rs
+++ b/tests/integration_tests/e2e_shell.rs
@@ -385,9 +385,9 @@ fn test_bash_e2e_multiple_switches() {
output
);
- // Should have returned to main (wt remove should work)
+ // Should have returned to test-repo (wt remove should work)
assert!(
- output.contains("main"),
+ output.contains("test-repo"),
"Expected wt remove to work, got: {}",
output
);
diff --git a/tests/integration_tests/e2e_shell_post_start.rs b/tests/integration_tests/e2e_shell_post_start.rs
index c224fb245..70f3ac84a 100644
--- a/tests/integration_tests/e2e_shell_post_start.rs
+++ b/tests/integration_tests/e2e_shell_post_start.rs
@@ -159,7 +159,7 @@ fn test_e2e_post_start_background_command(#[case] shell: &str) {
r#"worktree-path = "../{main-worktree}.{branch}"
[[approved-commands]]
-project = "main"
+project = "test-repo"
command = "sleep 0.5 && echo 'Background task done' > bg_marker.txt"
"#,
)
@@ -199,7 +199,11 @@ command = "sleep 0.5 && echo 'Background task done' > bg_marker.txt"
thread::sleep(Duration::from_secs(2));
// Verify background command actually ran
- let worktree_path = repo.root_path().parent().unwrap().join("main.bg-feature");
+ let worktree_path = repo
+ .root_path()
+ .parent()
+ .unwrap()
+ .join("test-repo.bg-feature");
// First check if log file was created (proves process was spawned)
let git_dir = worktree_path.join(".git");
@@ -285,11 +289,11 @@ task2 = "sleep 0.5 && echo 'Task 2' > task2.txt"
r#"worktree-path = "../{main-worktree}.{branch}"
[[approved-commands]]
-project = "main"
+project = "test-repo"
command = "sleep 0.5 && echo 'Task 1' > task1.txt"
[[approved-commands]]
-project = "main"
+project = "test-repo"
command = "sleep 0.5 && echo 'Task 2' > task2.txt"
"#,
)
@@ -371,7 +375,7 @@ fn test_bash_post_create_blocks() {
r#"worktree-path = "../{main-worktree}.{branch}"
[[approved-commands]]
-project = "main"
+project = "test-repo"
command = "echo 'Setup done' > setup.txt"
"#,
)
@@ -388,7 +392,7 @@ command = "echo 'Setup done' > setup.txt"
.root_path()
.parent()
.unwrap()
- .join("main.blocking-test");
+ .join("test-repo.blocking-test");
let script = format!(
r#"
export PATH="{}:$PATH"
@@ -457,7 +461,7 @@ fish_bg = "sleep 0.5 && echo 'Fish background done' > fish_bg.txt"
r#"worktree-path = "../{main-worktree}.{branch}"
[[approved-commands]]
-project = "main"
+project = "test-repo"
command = "sleep 0.5 && echo 'Fish background done' > fish_bg.txt"
"#,
)
diff --git a/tests/integration_tests/post_start_commands.rs b/tests/integration_tests/post_start_commands.rs
index c611e993d..1319447d7 100644
--- a/tests/integration_tests/post_start_commands.rs
+++ b/tests/integration_tests/post_start_commands.rs
@@ -245,25 +245,25 @@ fn test_post_create_template_expansion() {
// Pre-approve all commands in temp HOME
let user_config_dir = temp_home.path().join(".config/worktrunk");
fs::create_dir_all(&user_config_dir).expect("Failed to create user config dir");
- let repo_name = "main";
+ let repo_name = "test-repo";
fs::write(
user_config_dir.join("config.toml"),
r#"worktree-path = "../{main-worktree}.{branch}"
[[approved-commands]]
-project = "main"
+project = "test-repo"
command = "echo 'Repo: {main-worktree}' > info.txt"
[[approved-commands]]
-project = "main"
+project = "test-repo"
command = "echo 'Branch: {branch}' >> info.txt"
[[approved-commands]]
-project = "main"
+project = "test-repo"
command = "echo 'Worktree: {worktree}' >> info.txt"
[[approved-commands]]
-project = "main"
+project = "test-repo"
command = "echo 'Root: {repo_root}' >> info.txt"
"#,
)
@@ -349,7 +349,7 @@ command = "sleep 1 && echo 'Background task done' > background.txt"
);
// Verify log file was created
- let worktree_path = repo.root_path().parent().unwrap().join("main.feature");
+ let worktree_path = repo.root_path().parent().unwrap().join("test-repo.feature");
let git_dir = resolve_git_dir(&worktree_path);
let log_dir = git_dir.join("wt-logs");
assert!(log_dir.exists(), "Log directory should be created");
@@ -415,7 +415,7 @@ command = "echo 'Task 2 running' > task2.txt"
thread::sleep(SLEEP_BACKGROUND_COMMAND);
// Verify both tasks ran
- let worktree_path = repo.root_path().parent().unwrap().join("main.feature");
+ let worktree_path = repo.root_path().parent().unwrap().join("test-repo.feature");
assert!(worktree_path.join("task1.txt").exists());
assert!(worktree_path.join("task2.txt").exists());
}
@@ -468,7 +468,7 @@ command = "sleep 0.5 && echo 'Server running' > server.txt"
);
// Setup file should exist immediately (post-create is blocking)
- let worktree_path = repo.root_path().parent().unwrap().join("main.feature");
+ let worktree_path = repo.root_path().parent().unwrap().join("test-repo.feature");
assert!(
worktree_path.join("setup.txt").exists(),
"Post-create command should have completed before wt exits"
@@ -550,7 +550,7 @@ command = "echo 'stdout output' && echo 'stderr output' >&2"
thread::sleep(SLEEP_FAST_COMMAND);
// Find and read the log file
- let worktree_path = repo.root_path().parent().unwrap().join("main.feature");
+ let worktree_path = repo.root_path().parent().unwrap().join("test-repo.feature");
let git_dir = resolve_git_dir(&worktree_path);
let log_dir = git_dir.join("wt-logs");
assert!(log_dir.exists(), "Log directory should exist");
@@ -625,7 +625,7 @@ command = "echo 'unclosed quote"
);
// Verify worktree was created despite command error
- let worktree_path = repo.root_path().parent().unwrap().join("main.feature");
+ let worktree_path = repo.root_path().parent().unwrap().join("test-repo.feature");
assert!(
worktree_path.exists(),
"Worktree should be created even if post-start command fails"
@@ -686,7 +686,7 @@ command = "echo 'TASK3_OUTPUT'"
thread::sleep(SLEEP_FAST_COMMAND);
// Verify we have 3 separate log files
- let worktree_path = repo.root_path().parent().unwrap().join("main.feature");
+ let worktree_path = repo.root_path().parent().unwrap().join("test-repo.feature");
let git_dir = resolve_git_dir(&worktree_path);
let log_dir = git_dir.join("wt-logs");
let log_files: Vec<_> = fs::read_dir(&log_dir)
@@ -782,7 +782,7 @@ command = "echo 'Background task' > background.txt"
Some(temp_home.path()),
);
- let worktree_path = repo.root_path().parent().unwrap().join("main.feature");
+ let worktree_path = repo.root_path().parent().unwrap().join("test-repo.feature");
// Execute flag file should exist immediately (synchronous)
assert!(
@@ -842,7 +842,7 @@ command = "echo 'line1\nline2\nline3' | grep line2 > filtered.txt"
thread::sleep(SLEEP_FAST_COMMAND);
// Verify the piped command worked correctly
- let worktree_path = repo.root_path().parent().unwrap().join("main.feature");
+ let worktree_path = repo.root_path().parent().unwrap().join("test-repo.feature");
let filtered_file = worktree_path.join("filtered.txt");
assert!(
filtered_file.exists(),
diff --git a/tests/snapshots/integration__integration_tests__init__init_elvish.snap b/tests/snapshots/integration__integration_tests__init__init_elvish.snap
new file mode 100644
index 000000000..5eec3dd5e
--- /dev/null
+++ b/tests/snapshots/integration__integration_tests__init__init_elvish.snap
@@ -0,0 +1,99 @@
+---
+source: tests/integration_tests/init.rs
+info:
+ program: wt
+ args:
+ - init
+ - elvish
+ env:
+ CLICOLOR_FORCE: "1"
+ GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"
+ GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
+ GIT_CONFIG_GLOBAL: /dev/null
+ GIT_CONFIG_SYSTEM: /dev/null
+ GIT_EDITOR: ""
+ LANG: C
+ LC_ALL: C
+ SOURCE_DATE_EPOCH: "1704067200"
+---
+success: false
+exit_code: 1
+----- stdout -----
+# worktrunk shell integration for elvish
+
+# Only initialize if wt is available
+if (has-external wt) {
+ # Use WORKTRUNK_BIN if set, otherwise default to 'wt'
+ # This allows testing development builds: set E:WORKTRUNK_BIN = ./target/debug/wt
+ var _WORKTRUNK_CMD = wt
+ if (has-env WORKTRUNK_BIN) {
+ set _WORKTRUNK_CMD = $E:WORKTRUNK_BIN
+ }
+
+ # Helper function to parse wt output and handle directives
+ # Directives are NUL-terminated to support multi-line commands
+ fn _wt_exec {|@args|
+ var exit-code = 0
+ var output = ""
+ var exec-cmd = ""
+
+ # Capture output and handle potential non-zero exit
+ # TODO: Capture actual exit code from wt command, not just success/failure
+ try {
+ set output = (e:$_WORKTRUNK_CMD $@args 2>&1 | slurp)
+ } catch e {
+ set exit-code = 1
+ set output = $e[reason][content]
+ }
+
+ # Split output on NUL bytes, process each chunk
+ var chunks = [(str:split "\x00" $output)]
+ for chunk $chunks {
+ if (str:has-prefix $chunk "__WORKTRUNK_CD__") {
+ # CD directive - extract path and change directory
+ var path = (str:trim-prefix $chunk "__WORKTRUNK_CD__")
+ cd $path
+ } elif (str:has-prefix $chunk "__WORKTRUNK_EXEC__") {
+ # EXEC directive - extract command (may contain newlines)
+ set exec-cmd = (str:trim-prefix $chunk "__WORKTRUNK_EXEC__")
+ } elif (!=s $chunk "") {
+ # Regular output - print it (preserving newlines)
+ print $chunk
+ }
+ }
+
+ # Execute command if one was specified
+ if (!=s $exec-cmd "") {
+ eval $exec-cmd
+ }
+
+ # Return exit code (will throw exception if non-zero)
+ if (!=s $exit-code 0) {
+ fail "command failed with exit code "$exit-code
+ }
+ }
+
+ # Override wt command to add --internal flag for switch, remove, and merge
+ fn wt {|@args|
+ if (== (count $args) 0) {
+ e:$_WORKTRUNK_CMD
+ return
+ }
+
+ var subcommand = $args[0]
+
+ if (or (eq $subcommand "switch") (eq $subcommand "remove") (eq $subcommand "merge")) {
+ # Commands that need --internal for directory change support
+ var rest-args = $args[1..]
+ _wt_exec $subcommand --internal $@rest-args
+ } else {
+ # All other commands pass through directly
+ e:$_WORKTRUNK_CMD $@args
+ }
+ }
+}
+
+# Static completions (commands and flags)
+
+----- stderr -----
+❌ Completion not yet supported for elvish
diff --git a/tests/snapshots/integration__integration_tests__init__init_nushell.snap b/tests/snapshots/integration__integration_tests__init__init_nushell.snap
new file mode 100644
index 000000000..cd19864a0
--- /dev/null
+++ b/tests/snapshots/integration__integration_tests__init__init_nushell.snap
@@ -0,0 +1,86 @@
+---
+source: tests/integration_tests/init.rs
+info:
+ program: wt
+ args:
+ - init
+ - nushell
+ env:
+ CLICOLOR_FORCE: "1"
+ GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"
+ GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
+ GIT_CONFIG_GLOBAL: /dev/null
+ GIT_CONFIG_SYSTEM: /dev/null
+ GIT_EDITOR: ""
+ LANG: C
+ LC_ALL: C
+ SOURCE_DATE_EPOCH: "1704067200"
+---
+success: false
+exit_code: 1
+----- stdout -----
+# worktrunk shell integration for nushell
+
+# Only initialize if wt is available
+if (which wt | is-not-empty) {
+ # Use WORKTRUNK_BIN if set, otherwise default to 'wt'
+ # This allows testing development builds: $env.WORKTRUNK_BIN = ./target/debug/wt
+ let _WORKTRUNK_CMD = (if ($env.WORKTRUNK_BIN? | is-not-empty) { $env.WORKTRUNK_BIN } else { "wt" })
+
+ # Helper function to parse wt output and handle directives
+ # Directives are NUL-terminated to support multi-line commands
+ export def --env _wt_exec [...args] {
+ let result = (do { ^$_WORKTRUNK_CMD ...$args } | complete)
+ mut exec_cmd = ""
+
+ # Split output on NUL bytes, process each chunk
+ for chunk in ($result.stdout | split row "\u{0000}") {
+ if ($chunk | str starts-with "__WORKTRUNK_CD__") {
+ # CD directive - extract path and change directory
+ # TODO: Use str replace instead of hard-coded offset (fragile if prefix changes)
+ let path = ($chunk | str substring 16..)
+ cd $path
+ } else if ($chunk | str starts-with "__WORKTRUNK_EXEC__") {
+ # EXEC directive - extract command (may contain newlines)
+ # TODO: Use str replace instead of hard-coded offset (fragile if prefix changes)
+ $exec_cmd = ($chunk | str substring 18..)
+ } else if ($chunk | str length) > 0 {
+ # Regular output - print it (preserving newlines)
+ print -n $chunk
+ }
+ }
+
+ # Execute command if one was specified
+ if ($exec_cmd != "") {
+ nu -c $exec_cmd
+ }
+
+ # Return the exit code
+ return $result.exit_code
+ }
+
+ # Override wt command to add --internal flag for switch, remove, and merge
+ # Use --wrapped to pass through all flags without parsing them
+ export def --env --wrapped wt [...rest] {
+ let subcommand = ($rest | get 0? | default "")
+
+ match $subcommand {
+ "switch" | "remove" | "merge" => {
+ # Commands that need --internal for directory change support
+ let rest_args = ($rest | skip 1)
+ let internal_args = ([$subcommand, "--internal"] | append $rest_args)
+ let exit_code = (_wt_exec ...$internal_args)
+ return $exit_code
+ }
+ _ => {
+ # All other commands pass through directly
+ ^$_WORKTRUNK_CMD ...$rest
+ }
+ }
+ }
+}
+
+# Static completions (commands and flags)
+
+----- stderr -----
+❌ Completion not yet supported for nushell
diff --git a/tests/snapshots/integration__integration_tests__init__init_oil.snap b/tests/snapshots/integration__integration_tests__init__init_oil.snap
new file mode 100644
index 000000000..25d25fdea
--- /dev/null
+++ b/tests/snapshots/integration__integration_tests__init__init_oil.snap
@@ -0,0 +1,398 @@
+---
+source: tests/integration_tests/init.rs
+info:
+ program: wt
+ args:
+ - init
+ - oil
+ env:
+ CLICOLOR_FORCE: "1"
+ GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"
+ GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
+ GIT_CONFIG_GLOBAL: /dev/null
+ GIT_CONFIG_SYSTEM: /dev/null
+ GIT_EDITOR: ""
+ LANG: C
+ LC_ALL: C
+ SOURCE_DATE_EPOCH: "1704067200"
+---
+success: true
+exit_code: 0
+----- stdout -----
+# worktrunk shell integration for oil
+
+# Only initialize if wt is available
+if command -v wt >/dev/null 2>&1; then
+ # Use WORKTRUNK_BIN if set, otherwise default to 'wt'
+ # This allows testing development builds: export WORKTRUNK_BIN=./target/debug/wt
+ _WORKTRUNK_CMD="${WORKTRUNK_BIN:-wt}"
+
+ # Helper function to parse wt output and handle directives
+ # Directives are NUL-terminated to support multi-line commands
+ _wt_exec() {
+ local exec_cmd="" chunk exit_code
+ local exit_code_file
+ exit_code_file=$(mktemp) || { echo "Failed to create temp file" >&2; return 1; }
+
+ # Parse output directly from wt (command substitution strips NUL bytes!)
+ # Use process substitution to preserve NUL bytes
+ # Write exit code to temp file since it can't be captured from process substitution
+ # The || [[ -n "$chunk" ]] handles non-NUL-terminated output (e.g., error messages)
+ while IFS= read -r -d '' chunk || [[ -n "$chunk" ]]; do
+ if [[ "$chunk" == __WORKTRUNK_CD__* ]]; then
+ # CD directive - extract path and change directory
+ local path="${chunk#__WORKTRUNK_CD__}"
+ \cd "$path"
+ elif [[ "$chunk" == __WORKTRUNK_EXEC__* ]]; then
+ # EXEC directive - extract command (may contain newlines)
+ exec_cmd="${chunk#__WORKTRUNK_EXEC__}"
+ else
+ # Regular output - print it (preserving newlines)
+ printf '%s' "$chunk"
+ fi
+ done < <(command "$_WORKTRUNK_CMD" "$@" 2>&1; echo "$?" > "$exit_code_file")
+
+ # Read exit code from temp file
+ exit_code=$(cat "$exit_code_file" 2>/dev/null || echo 0)
+
+ # Cleanup temp file
+ \rm -f "$exit_code_file"
+
+ # Execute command if one was specified
+ # Security: Command is user-provided from -x flag; eval is intentional.
+ # NUL-termination allows multi-line commands.
+ # Exit code semantics: Returns wt's exit code, not the executed command's.
+ # This allows detecting wt failures (e.g., branch creation errors).
+ # The executed command runs for side effects; its failure is logged but doesn't affect exit code.
+ if [[ -n "$exec_cmd" ]]; then
+ if ! eval "$exec_cmd"; then
+ echo "Warning: Command execution failed (exit code $?)" >&2
+ fi
+ fi
+
+ return $exit_code
+ }
+
+ # Override wt command to add --internal flag for switch, remove, and merge
+ wt() {
+ local subcommand="$1"
+
+ case "$subcommand" in
+ switch|remove|merge)
+ # Commands that need --internal for directory change support
+ shift
+ _wt_exec "$subcommand" --internal "$@"
+ ;;
+ *)
+ # All other commands pass through directly
+ command "$_WORKTRUNK_CMD" "$@"
+ ;;
+ esac
+ }
+
+ # Dynamic completion function
+ _wt_complete() {
+ local cur="${COMP_WORDS[COMP_CWORD]}"
+
+ # Call wt complete with current command line
+ local completions=$(command "$_WORKTRUNK_CMD" complete "${COMP_WORDS[@]}" 2>/dev/null)
+ COMPREPLY=($(compgen -W "$completions" -- "$cur"))
+ }
+
+ # Register dynamic completion
+ complete -F _wt_complete wt
+fi
+
+# Static completions (commands and flags)
+_wt() {
+ local i cur prev opts cmd
+ COMPREPLY=()
+ if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then
+ cur="$2"
+ else
+ cur="${COMP_WORDS[COMP_CWORD]}"
+ fi
+ prev="$3"
+ cmd=""
+ opts=""
+
+ for i in "${COMP_WORDS[@]:0:COMP_CWORD}"
+ do
+ case "${cmd},${i}" in
+ ",$1")
+ cmd="wt"
+ ;;
+ wt,complete)
+ cmd="wt__complete"
+ ;;
+ wt,completion)
+ cmd="wt__completion"
+ ;;
+ wt,config)
+ cmd="wt__config"
+ ;;
+ wt,configure-shell)
+ cmd="wt__configure__shell"
+ ;;
+ wt,init)
+ cmd="wt__init"
+ ;;
+ wt,list)
+ cmd="wt__list"
+ ;;
+ wt,merge)
+ cmd="wt__merge"
+ ;;
+ wt,push)
+ cmd="wt__push"
+ ;;
+ wt,remove)
+ cmd="wt__remove"
+ ;;
+ wt,switch)
+ cmd="wt__switch"
+ ;;
+ wt__config,init)
+ cmd="wt__config__init"
+ ;;
+ wt__config,list)
+ cmd="wt__config__list"
+ ;;
+ *)
+ ;;
+ esac
+ done
+
+ case "${cmd}" in
+ wt)
+ opts="-v -h -V --verbose --help --version init configure-shell config list switch remove push merge completion complete"
+ if [[ ${cur} == -* || ${COMP_CWORD} -eq 1 ]] ; then
+ COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
+ return 0
+ fi
+ case "${prev}" in
+ *)
+ COMPREPLY=()
+ ;;
+ esac
+ COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
+ return 0
+ ;;
+ wt__complete)
+ opts="-v -h --verbose --help [ARGS]..."
+ if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
+ COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
+ return 0
+ fi
+ case "${prev}" in
+ *)
+ COMPREPLY=()
+ ;;
+ esac
+ COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
+ return 0
+ ;;
+ wt__completion)
+ opts="-v -h --verbose --help bash elvish fish nushell oil powershell xonsh zsh"
+ if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
+ COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
+ return 0
+ fi
+ case "${prev}" in
+ *)
+ COMPREPLY=()
+ ;;
+ esac
+ COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
+ return 0
+ ;;
+ wt__config)
+ opts="-v -h --verbose --help init list"
+ if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
+ COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
+ return 0
+ fi
+ case "${prev}" in
+ *)
+ COMPREPLY=()
+ ;;
+ esac
+ COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
+ return 0
+ ;;
+ wt__config__init)
+ opts="-v -h --verbose --help"
+ if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
+ COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
+ return 0
+ fi
+ case "${prev}" in
+ *)
+ COMPREPLY=()
+ ;;
+ esac
+ COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
+ return 0
+ ;;
+ wt__config__list)
+ opts="-v -h --verbose --help"
+ if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
+ COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
+ return 0
+ fi
+ case "${prev}" in
+ *)
+ COMPREPLY=()
+ ;;
+ esac
+ COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
+ return 0
+ ;;
+ wt__configure__shell)
+ opts="-y -v -h --shell --cmd --yes --verbose --help"
+ if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
+ COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
+ return 0
+ fi
+ case "${prev}" in
+ --shell)
+ COMPREPLY=($(compgen -W "bash elvish fish nushell oil powershell xonsh zsh" -- "${cur}"))
+ return 0
+ ;;
+ --cmd)
+ COMPREPLY=($(compgen -f "${cur}"))
+ return 0
+ ;;
+ *)
+ COMPREPLY=()
+ ;;
+ esac
+ COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
+ return 0
+ ;;
+ wt__init)
+ opts="-v -h --cmd --verbose --help <SHELL>"
+ if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
+ COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
+ return 0
+ fi
+ case "${prev}" in
+ --cmd)
+ COMPREPLY=($(compgen -f "${cur}"))
+ return 0
+ ;;
+ *)
+ COMPREPLY=()
+ ;;
+ esac
+ COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
+ return 0
+ ;;
+ wt__list)
+ opts="-v -h --format --branches --verbose --help"
+ if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
+ COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
+ return 0
+ fi
+ case "${prev}" in
+ --format)
+ COMPREPLY=($(compgen -W "table json" -- "${cur}"))
+ return 0
+ ;;
+ *)
+ COMPREPLY=()
+ ;;
+ esac
+ COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
+ return 0
+ ;;
+ wt__merge)
+ opts="-s -k -m -f -v -h --squash --keep --message --no-verify --force --verbose --help [TARGET]"
+ if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
+ COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
+ return 0
+ fi
+ case "${prev}" in
+ --message)
+ COMPREPLY=($(compgen -f "${cur}"))
+ return 0
+ ;;
+ -m)
+ COMPREPLY=($(compgen -f "${cur}"))
+ return 0
+ ;;
+ *)
+ COMPREPLY=()
+ ;;
+ esac
+ COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
+ return 0
+ ;;
+ wt__push)
+ opts="-v -h --allow-merge-commits --verbose --help [TARGET]"
+ if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
+ COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
+ return 0
+ fi
+ case "${prev}" in
+ *)
+ COMPREPLY=()
+ ;;
+ esac
+ COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
+ return 0
+ ;;
+ wt__remove)
+ opts="-v -h --verbose --help"
+ if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
+ COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
+ return 0
+ fi
+ case "${prev}" in
+ *)
+ COMPREPLY=()
+ ;;
+ esac
+ COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
+ return 0
+ ;;
+ wt__switch)
+ opts="-c -b -x -f -v -h --create --base --execute --force --no-config-commands --verbose --help <BRANCH>"
+ if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
+ COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
+ return 0
+ fi
+ case "${prev}" in
+ --base)
+ COMPREPLY=($(compgen -f "${cur}"))
+ return 0
+ ;;
+ -b)
+ COMPREPLY=($(compgen -f "${cur}"))
+ return 0
+ ;;
+ --execute)
+ COMPREPLY=($(compgen -f "${cur}"))
+ return 0
+ ;;
+ -x)
+ COMPREPLY=($(compgen -f "${cur}"))
+ return 0
+ ;;
+ *)
+ COMPREPLY=()
+ ;;
+ esac
+ COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
+ return 0
+ ;;
+ esac
+}
+
+if [[ "${BASH_VERSINFO[0]}" -eq 4 && "${BASH_VERSINFO[1]}" -ge 4 || "${BASH_VERSINFO[0]}" -gt 4 ]]; then
+ complete -F _wt -o nosort -o bashdefault -o default wt
+else
+ complete -F _wt -o bashdefault -o default wt
+fi
+
+----- stderr -----
diff --git a/tests/snapshots/integration__integration_tests__init__init_powershell.snap b/tests/snapshots/integration__integration_tests__init__init_powershell.snap
new file mode 100644
index 000000000..f37bcff55
--- /dev/null
+++ b/tests/snapshots/integration__integration_tests__init__init_powershell.snap
@@ -0,0 +1,101 @@
+---
+source: tests/integration_tests/init.rs
+info:
+ program: wt
+ args:
+ - init
+ - powershell
+ env:
+ CLICOLOR_FORCE: "1"
+ GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"
+ GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
+ GIT_CONFIG_GLOBAL: /dev/null
+ GIT_CONFIG_SYSTEM: /dev/null
+ GIT_EDITOR: ""
+ LANG: C
+ LC_ALL: C
+ SOURCE_DATE_EPOCH: "1704067200"
+---
+success: false
+exit_code: 1
+----- stdout -----
+# worktrunk shell integration for PowerShell
+
+# Only initialize if wt is available
+if (Get-Command wt -ErrorAction SilentlyContinue) {
+ # Use WORKTRUNK_BIN if set, otherwise default to 'wt'
+ # This allows testing development builds: $env:WORKTRUNK_BIN = "./target/debug/wt"
+ $script:_WORKTRUNK_CMD = if ($env:WORKTRUNK_BIN) { $env:WORKTRUNK_BIN } else { "wt" }
+
+ # Helper function to parse wt output and handle directives
+ # Directives are NUL-terminated to support multi-line commands
+ function _wt_exec {
+ param(
+ [Parameter(ValueFromRemainingArguments=$true)]
+ [string[]]$Arguments
+ )
+
+ # Capture output and exit code
+ $output = & $script:_WORKTRUNK_CMD @Arguments 2>&1 | Out-String
+ $exitCode = $LASTEXITCODE
+ $execCmd = ""
+
+ # Split output on NUL bytes, process each chunk
+ foreach ($chunk in ($output -split "`0")) {
+ if ($chunk -match '^__WORKTRUNK_CD__') {
+ # CD directive - extract path and change directory
+ $path = $chunk -replace '^__WORKTRUNK_CD__', ''
+ Set-Location $path
+ } elseif ($chunk -match '^__WORKTRUNK_EXEC__') {
+ # EXEC directive - extract command (may contain newlines)
+ $execCmd = $chunk -replace '^__WORKTRUNK_EXEC__', ''
+ } elseif ($chunk) {
+ # Regular output - write it (preserving newlines)
+ # TODO: Use Write-Output instead of Write-Host for redirectable output
+ Write-Host -NoNewline $chunk
+ }
+ }
+
+ # Execute command if one was specified
+ if ($execCmd) {
+ Invoke-Expression $execCmd
+ }
+
+ # Return the exit code
+ return $exitCode
+ }
+
+ # Override wt command to add --internal flag for switch, remove, and merge
+ function wt {
+ param(
+ [Parameter(ValueFromRemainingArguments=$true)]
+ [string[]]$Arguments
+ )
+
+ if ($Arguments.Count -eq 0) {
+ & $script:_WORKTRUNK_CMD
+ return $LASTEXITCODE
+ }
+
+ $subcommand = $Arguments[0]
+
+ switch ($subcommand) {
+ { $_ -in @("switch", "remove", "merge") } {
+ # Commands that need --internal for directory change support
+ $restArgs = $Arguments[1..($Arguments.Count-1)]
+ $exitCode = _wt_exec $subcommand --internal @restArgs
+ return $exitCode
+ }
+ default {
+ # All other commands pass through directly
+ & $script:_WORKTRUNK_CMD @Arguments
+ return $LASTEXITCODE
+ }
+ }
+ }
+}
+
+# Static completions (commands and flags)
+
+----- stderr -----
+❌ Completion not yet supported for powershell
diff --git a/tests/snapshots/integration__integration_tests__init__init_xonsh.snap b/tests/snapshots/integration__integration_tests__init__init_xonsh.snap
new file mode 100644
index 000000000..5731ae577
--- /dev/null
+++ b/tests/snapshots/integration__integration_tests__init__init_xonsh.snap
@@ -0,0 +1,87 @@
+---
+source: tests/integration_tests/init.rs
+info:
+ program: wt
+ args:
+ - init
+ - xonsh
+ env:
+ CLICOLOR_FORCE: "1"
+ GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"
+ GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
+ GIT_CONFIG_GLOBAL: /dev/null
+ GIT_CONFIG_SYSTEM: /dev/null
+ GIT_EDITOR: ""
+ LANG: C
+ LC_ALL: C
+ SOURCE_DATE_EPOCH: "1704067200"
+---
+success: false
+exit_code: 1
+----- stdout -----
+# worktrunk shell integration for xonsh
+
+# Only initialize if wt is available
+import shutil
+import os
+if shutil.which("wt") is not None:
+ # Use WORKTRUNK_BIN if set, otherwise default to 'wt'
+ # This allows testing development builds: $WORKTRUNK_BIN = ./target/debug/wt
+ _WORKTRUNK_CMD = os.environ.get('WORKTRUNK_BIN', 'wt')
+
+ def _wt_exec(args):
+ """Helper function to parse wt output and handle directives
+ Directives are NUL-terminated to support multi-line commands"""
+ # Capture full output including return code
+ result = ![@(_WORKTRUNK_CMD) @(args)]
+ exec_cmd = ""
+
+ # Split output on NUL bytes, process each chunk
+ if result.out:
+ for chunk in result.out.split("\0"):
+ if chunk.startswith("__WORKTRUNK_CD__"):
+ # CD directive - extract path and change directory
+ # TODO: Use str.replace instead of hard-coded offset (fragile if prefix changes)
+ path = chunk[16:] # Remove prefix
+ cd @(path)
+ elif chunk.startswith("__WORKTRUNK_EXEC__"):
+ # EXEC directive - extract command (may contain newlines)
+ # TODO: Use str.replace instead of hard-coded offset (fragile if prefix changes)
+ exec_cmd = chunk[18:] # Remove prefix
+ elif chunk:
+ # Regular output - print it (preserving newlines)
+ print(chunk, end='')
+
+ # Execute command if one was specified
+ if exec_cmd:
+ execx(exec_cmd)
+
+ # Return the exit code
+ # TODO: Add fallback for None: return result.returncode or 0
+ return result.returncode
+
+ def _wt_wrapper(args):
+ """Override wt command to add --internal flag for switch, remove, and merge"""
+ if not args:
+ # No arguments, just run wt
+ ![@(_WORKTRUNK_CMD)]
+ return
+
+ subcommand = args[0]
+
+ if subcommand in ["switch", "remove", "merge"]:
+ # Commands that need --internal for directory change support
+ rest_args = args[1:]
+ return _wt_exec([subcommand, "--internal"] + rest_args)
+ else:
+ # All other commands pass through directly
+ result = ![@(_WORKTRUNK_CMD) @(args)]
+ return result.returncode
+
+ # Register the alias
+ aliases['wt'] = _wt_wrapper
+
+# Static completions (commands and flags)
+
+----- stderr -----
+❌ Completion not yet supported for xonsh
diff --git a/tests/snapshots/integration__integration_tests__list__locked_no_reason.snap b/tests/snapshots/integration__integration_tests__list__locked_no_reason.snap
index 4bf35b715..6c9d1454a 100644
--- a/tests/snapshots/integration__integration_tests__list__locked_no_reason.snap
+++ b/tests/snapshots/integration__integration_tests__list__locked_no_reason.snap
@@ -19,7 +19,7 @@ success: true
exit_code: 0
----- stdout -----
Branch  Age  Commit  State  Path
-main  9 months ago b834638e ./main
+main  9 months ago b834638e ./test-repo
locked-no-reason 9 months ago b834638e (locked) ./locked-no-reason
Showing 2 worktrees
diff --git a/tests/snapshots/integration__integration_tests__list__locked_worktree.snap b/tests/snapshots/integration__integration_tests__list__locked_worktree.snap
index fda961993..3c689f46b 100644
--- a/tests/snapshots/integration__integration_tests__list__locked_worktree.snap
+++ b/tests/snapshots/integration__integration_tests__list__locked_worktree.snap
@@ -19,7 +19,7 @@ success: true
exit_code: 0
----- stdout -----
Branch  Age  Commit  Message  Path
-main  9 months ago b834638e Initial commit ./main
+main  9 months ago b834638e Initial commit ./test-repo
locked-feature 9 months ago b834638e Initial commit ./locked-feature
Showing 2 worktrees
diff --git a/tests/snapshots/integration__integration_tests__list__long_commit_message.snap b/tests/snapshots/integration__integration_tests__list__long_commit_message.snap
index 3595de134..bb3ee2d78 100644
--- a/tests/snapshots/integration__integration_tests__list__long_commit_message.snap
+++ b/tests/snapshots/integration__integration_tests__list__long_commit_message.snap
@@ -19,7 +19,7 @@ success: true
exit_code: 0
----- stdout -----
Branch  Age  Commit  Message  Path
-main  9 months ago 1310bfb9 Short message ./main
+main  9 months ago 1310bfb9 Short message ./test-repo
feature-a 9 months ago f078644e This is a very long commit... ./feature-a
Showing 2 worktrees, 1 behind
diff --git a/tests/snapshots/integration__integration_tests__list__many_worktrees_varied.snap b/tests/snapshots/integration__integration_tests__list__many_worktrees_varied.snap
index a8c6d34ca..dda93cc06 100644
--- a/tests/snapshots/integration__integration_tests__list__many_worktrees_varied.snap
+++ b/tests/snapshots/integration__integration_tests__list__many_worktrees_varied.snap
@@ -19,7 +19,7 @@ success: true
exit_code: 0
----- stdout -----
Branch  Age  Commit  Path
-main  9 months ago b834638e ./main
+main  9 months ago b834638e ./test-repo
medium-name 9 months ago b834638e ./medium-name
short 9 months ago b834638e ./short
very-long-branch-name-here 9 months ago b834638e ./very-long-branch-name-here
diff --git a/tests/snapshots/integration__integration_tests__list__multiple_worktrees.snap b/tests/snapshots/integration__integration_tests__list__multiple_worktrees.snap
index 7e6da327f..cfd3b104d 100644
--- a/tests/snapshots/integration__integration_tests__list__multiple_worktrees.snap
+++ b/tests/snapshots/integration__integration_tests__list__multiple_worktrees.snap
@@ -19,7 +19,7 @@ success: true
exit_code: 0
----- stdout -----
Branch  Age  Commit  Message  Path
-main  9 months ago b834638e Initial commit ./main
+main  9 months ago b834638e Initial commit ./test-repo
feature-a 9 months ago b834638e Initial commit ./feature-a
feature-b 9 months ago b834638e Initial commit ./feature-b
diff --git a/tests/snapshots/integration__integration_tests__list__unicode_commit_message.snap b/tests/snapshots/integration__integration_tests__list__unicode_commit_message.snap
index 77930e7fd..1c019a848 100644
--- a/tests/snapshots/integration__integration_tests__list__unicode_commit_message.snap
+++ b/tests/snapshots/integration__integration_tests__list__unicode_commit_message.snap
@@ -19,7 +19,7 @@ success: true
exit_code: 0
----- stdout -----
Branch  Age  Commit  Message  Path
-main  9 months ago e4614cb7 Fix bug with cafΓ© β˜•... ./main
+main  9 months ago e4614cb7 Fix bug with cafΓ© β˜•... ./test-repo
feature-test 9 months ago 0c53695b Add support for... ./feature-test
Showing 2 worktrees, 1 behind
diff --git a/tests/snapshots/integration__integration_tests__list__with_branches_flag.snap b/tests/snapshots/integration__integration_tests__list__with_branches_flag.snap
index dc2459b4c..f314c31f2 100644
--- a/tests/snapshots/integration__integration_tests__list__with_branches_flag.snap
+++ b/tests/snapshots/integration__integration_tests__list__with_branches_flag.snap
@@ -20,7 +20,7 @@ success: true
exit_code: 0
----- stdout -----
Branch  Age  Commit  Path
-main  9 months ago b834638e ./main
+main  9 months ago b834638e ./test-repo
feature-with-worktree 9 months ago b834638e ./feature-with-worktree
another-branch 9 months ago b834638e
feature-without-worktree 9 months ago b834638e
diff --git a/tests/snapshots/integration__integration_tests__list__with_branches_flag_none_available.snap b/tests/snapshots/integration__integration_tests__list__with_branches_flag_none_available.snap
index 22906b563..0af8cf4c0 100644
--- a/tests/snapshots/integration__integration_tests__list__with_branches_flag_none_available.snap
+++ b/tests/snapshots/integration__integration_tests__list__with_branches_flag_none_available.snap
@@ -20,7 +20,7 @@ success: true
exit_code: 0
----- stdout -----
Branch  Age  Commit  Message  Path
-main  9 months ago b834638e Initial commit ./main
+main  9 months ago b834638e Initial commit ./test-repo
feature-a 9 months ago b834638e Initial commit ./feature-a
feature-b 9 months ago b834638e Initial commit ./feature-b
diff --git a/tests/snapshots/integration__integration_tests__post_start_commands__both_create_and_start.snap b/tests/snapshots/integration__integration_tests__post_start_commands__both_create_and_start.snap
index c30ccacbc..c15b61d36 100644
--- a/tests/snapshots/integration__integration_tests__post_start_commands__both_create_and_start.snap
+++ b/tests/snapshots/integration__integration_tests__post_start_commands__both_create_and_start.snap
@@ -13,7 +13,7 @@ info:
GIT_CONFIG_GLOBAL: /dev/null
GIT_CONFIG_SYSTEM: /dev/null
GIT_EDITOR: ""
- HOME: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpDBx8wC
+ HOME: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpKHkSRe
LANG: C
LC_ALL: C
SOURCE_DATE_EPOCH: "1704067200"
@@ -22,7 +22,7 @@ success: true
exit_code: 0
----- stdout -----
βœ… Created new worktree for feature
- Path: [REPO].feature
+ Path: [REPO]/../test-repo.feature
To enable automatic cd, run: wt configure-shell
diff --git a/tests/snapshots/integration__integration_tests__post_start_commands__execute_with_post_start.snap b/tests/snapshots/integration__integration_tests__post_start_commands__execute_with_post_start.snap
index e35f0ac7a..0a5069243 100644
--- a/tests/snapshots/integration__integration_tests__post_start_commands__execute_with_post_start.snap
+++ b/tests/snapshots/integration__integration_tests__post_start_commands__execute_with_post_start.snap
@@ -15,7 +15,7 @@ info:
GIT_CONFIG_GLOBAL: /dev/null
GIT_CONFIG_SYSTEM: /dev/null
GIT_EDITOR: ""
- HOME: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmppAp6Di
+ HOME: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpyp4YON
LANG: C
LC_ALL: C
SOURCE_DATE_EPOCH: "1704067200"
@@ -24,7 +24,7 @@ success: true
exit_code: 0
----- stdout -----
βœ… Created new worktree for feature
- Path: [REPO].feature
+ Path: [REPO]/../test-repo.feature
----- stderr -----
diff --git a/tests/snapshots/integration__integration_tests__post_start_commands__invalid_toml.snap b/tests/snapshots/integration__integration_tests__post_start_commands__invalid_toml.snap
index 2832c956e..f3222031f 100644
--- a/tests/snapshots/integration__integration_tests__post_start_commands__invalid_toml.snap
+++ b/tests/snapshots/integration__integration_tests__post_start_commands__invalid_toml.snap
@@ -17,28 +17,14 @@ info:
LC_ALL: C
SOURCE_DATE_EPOCH: "1704067200"
---
-success: true
-exit_code: 0
+success: false
+exit_code: 1
----- stdout -----
-βœ… Created new worktree for feature
- Path: [REPO].feature
-
-To enable automatic cd, run: wt configure-shell
----- stderr -----
-🟑 Failed to load project config from [REPO]/.config/wt.toml
-πŸ’‘ Error details: TOML parse error at line 1, column 39
- |
-1 | post-create-command = [invalid syntax
- | ^
-unclosed array, expected `]`
- in .config/wt.toml
-πŸ’‘ Skipping commands. Check TOML syntax if file exists.
-🟑 Failed to load project config from [REPO]/.config/wt.toml
-πŸ’‘ Error details: TOML parse error at line 1, column 39
+Failed to load project config: TOML parse error at line 1, column 39
|
1 | post-create-command = [invalid syntax
| ^
unclosed array, expected `]`
- in .config/wt.toml
-πŸ’‘ Skipping commands. Check TOML syntax if file exists.
+ in .config/wt.toml
diff --git a/tests/snapshots/integration__integration_tests__post_start_commands__post_create_failing_command.snap b/tests/snapshots/integration__integration_tests__post_start_commands__post_create_failing_command.snap
index ebd38bc03..e9c2e8adc 100644
--- a/tests/snapshots/integration__integration_tests__post_start_commands__post_create_failing_command.snap
+++ b/tests/snapshots/integration__integration_tests__post_start_commands__post_create_failing_command.snap
@@ -13,7 +13,7 @@ info:
GIT_CONFIG_GLOBAL: /dev/null
GIT_CONFIG_SYSTEM: /dev/null
GIT_EDITOR: ""
- HOME: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpE6TWZJ
+ HOME: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpnLywt9
LANG: C
LC_ALL: C
SOURCE_DATE_EPOCH: "1704067200"
@@ -22,7 +22,7 @@ success: true
exit_code: 0
----- stdout -----
βœ… Created new worktree for feature
- Path: [REPO].feature
+ Path: [REPO]/../test-repo.feature
To enable automatic cd, run: wt configure-shell
diff --git a/tests/snapshots/integration__integration_tests__post_start_commands__post_create_multiple_commands_array.snap b/tests/snapshots/integration__integration_tests__post_start_commands__post_create_multiple_commands_array.snap
index 85f131e6f..4fda35dac 100644
--- a/tests/snapshots/integration__integration_tests__post_start_commands__post_create_multiple_commands_array.snap
+++ b/tests/snapshots/integration__integration_tests__post_start_commands__post_create_multiple_commands_array.snap
@@ -13,7 +13,7 @@ info:
GIT_CONFIG_GLOBAL: /dev/null
GIT_CONFIG_SYSTEM: /dev/null
GIT_EDITOR: ""
- HOME: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpiQZs3j
+ HOME: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmp0uygJv
LANG: C
LC_ALL: C
SOURCE_DATE_EPOCH: "1704067200"
@@ -24,7 +24,7 @@ exit_code: 0
First
Second
βœ… Created new worktree for feature
- Path: [REPO].feature
+ Path: [REPO]/../test-repo.feature
To enable automatic cd, run: wt configure-shell
diff --git a/tests/snapshots/integration__integration_tests__post_start_commands__post_create_named_commands.snap b/tests/snapshots/integration__integration_tests__post_start_commands__post_create_named_commands.snap
index f530af483..53da6c1ed 100644
--- a/tests/snapshots/integration__integration_tests__post_start_commands__post_create_named_commands.snap
+++ b/tests/snapshots/integration__integration_tests__post_start_commands__post_create_named_commands.snap
@@ -13,7 +13,7 @@ info:
GIT_CONFIG_GLOBAL: /dev/null
GIT_CONFIG_SYSTEM: /dev/null
GIT_EDITOR: ""
- HOME: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpGPHO4z
+ HOME: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpfRJrjF
LANG: C
LC_ALL: C
SOURCE_DATE_EPOCH: "1704067200"
@@ -24,7 +24,7 @@ exit_code: 0
Installing deps
Running setup
βœ… Created new worktree for feature
- Path: [REPO].feature
+ Path: [REPO]/../test-repo.feature
To enable automatic cd, run: wt configure-shell
diff --git a/tests/snapshots/integration__integration_tests__post_start_commands__post_create_no_config.snap b/tests/snapshots/integration__integration_tests__post_start_commands__post_create_no_config.snap
index 8c438a5fb..17ed5284f 100644
--- a/tests/snapshots/integration__integration_tests__post_start_commands__post_create_no_config.snap
+++ b/tests/snapshots/integration__integration_tests__post_start_commands__post_create_no_config.snap
@@ -21,7 +21,7 @@ success: true
exit_code: 0
----- stdout -----
βœ… Created new worktree for feature
- Path: [REPO].feature
+ Path: [REPO]/../test-repo.feature
To enable automatic cd, run: wt configure-shell
diff --git a/tests/snapshots/integration__integration_tests__post_start_commands__post_create_single_command.snap b/tests/snapshots/integration__integration_tests__post_start_commands__post_create_single_command.snap
index 158ddb79b..4f3f61a66 100644
--- a/tests/snapshots/integration__integration_tests__post_start_commands__post_create_single_command.snap
+++ b/tests/snapshots/integration__integration_tests__post_start_commands__post_create_single_command.snap
@@ -13,7 +13,7 @@ info:
GIT_CONFIG_GLOBAL: /dev/null
GIT_CONFIG_SYSTEM: /dev/null
GIT_EDITOR: ""
- HOME: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpN3QRin
+ HOME: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpCIH1Ds
LANG: C
LC_ALL: C
SOURCE_DATE_EPOCH: "1704067200"
@@ -23,7 +23,7 @@ exit_code: 0
----- stdout -----
Setup complete
βœ… Created new worktree for feature
- Path: [REPO].feature
+ Path: [REPO]/../test-repo.feature
To enable automatic cd, run: wt configure-shell
diff --git a/tests/snapshots/integration__integration_tests__post_start_commands__post_create_template_expansion.snap b/tests/snapshots/integration__integration_tests__post_start_commands__post_create_template_expansion.snap
index caee0cbc9..637065996 100644
--- a/tests/snapshots/integration__integration_tests__post_start_commands__post_create_template_expansion.snap
+++ b/tests/snapshots/integration__integration_tests__post_start_commands__post_create_template_expansion.snap
@@ -13,7 +13,7 @@ info:
GIT_CONFIG_GLOBAL: /dev/null
GIT_CONFIG_SYSTEM: /dev/null
GIT_EDITOR: ""
- HOME: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpBf74y9
+ HOME: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpWzrP13
LANG: C
LC_ALL: C
SOURCE_DATE_EPOCH: "1704067200"
@@ -22,16 +22,16 @@ success: true
exit_code: 0
----- stdout -----
βœ… Created new worktree for feature/test
- Path: [REPO].feature-test
+ Path: [REPO]/../test-repo.feature-test
To enable automatic cd, run: wt configure-shell
----- stderr -----
πŸ”„ Executing (post-create):
-  echo 'Repo: main' > info.txt
+  echo 'Repo: test-repo' > info.txt
πŸ”„ Executing (post-create):
  echo 'Branch: feature-test' >> info.txt
πŸ”„ Executing (post-create):
-  echo 'Worktree: [REPO].feature-test' >> info.txt
+  echo 'Worktree: [REPO]/../test-repo.feature-test' >> info.txt
πŸ”„ Executing (post-create):
  echo 'Root: [REPO]' >> info.txt
diff --git a/tests/snapshots/integration__integration_tests__post_start_commands__post_start_complex_shell.snap b/tests/snapshots/integration__integration_tests__post_start_commands__post_start_complex_shell.snap
index 6eb25a0b1..ca8491f42 100644
--- a/tests/snapshots/integration__integration_tests__post_start_commands__post_start_complex_shell.snap
+++ b/tests/snapshots/integration__integration_tests__post_start_commands__post_start_complex_shell.snap
@@ -13,7 +13,7 @@ info:
GIT_CONFIG_GLOBAL: /dev/null
GIT_CONFIG_SYSTEM: /dev/null
GIT_EDITOR: ""
- HOME: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmp4ONp21
+ HOME: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpAjLGDp
LANG: C
LC_ALL: C
SOURCE_DATE_EPOCH: "1704067200"
@@ -22,7 +22,7 @@ success: true
exit_code: 0
----- stdout -----
βœ… Created new worktree for feature
- Path: [REPO].feature
+ Path: [REPO]/../test-repo.feature
To enable automatic cd, run: wt configure-shell
diff --git a/tests/snapshots/integration__integration_tests__post_start_commands__post_start_invalid_command.snap b/tests/snapshots/integration__integration_tests__post_start_commands__post_start_invalid_command.snap
index 0bddb8cf9..0797e1aa2 100644
--- a/tests/snapshots/integration__integration_tests__post_start_commands__post_start_invalid_command.snap
+++ b/tests/snapshots/integration__integration_tests__post_start_commands__post_start_invalid_command.snap
@@ -13,7 +13,7 @@ info:
GIT_CONFIG_GLOBAL: /dev/null
GIT_CONFIG_SYSTEM: /dev/null
GIT_EDITOR: ""
- HOME: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpAUf5hw
+ HOME: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpsrsqrn
LANG: C
LC_ALL: C
SOURCE_DATE_EPOCH: "1704067200"
@@ -22,7 +22,7 @@ success: true
exit_code: 0
----- stdout -----
βœ… Created new worktree for feature
- Path: [REPO].feature
+ Path: [REPO]/../test-repo.feature
To enable automatic cd, run: wt configure-shell
diff --git a/tests/snapshots/integration__integration_tests__post_start_commands__post_start_log_captures_output.snap b/tests/snapshots/integration__integration_tests__post_start_commands__post_start_log_captures_output.snap
index 26ab355f4..5a73a461a 100644
--- a/tests/snapshots/integration__integration_tests__post_start_commands__post_start_log_captures_output.snap
+++ b/tests/snapshots/integration__integration_tests__post_start_commands__post_start_log_captures_output.snap
@@ -13,7 +13,7 @@ info:
GIT_CONFIG_GLOBAL: /dev/null
GIT_CONFIG_SYSTEM: /dev/null
GIT_EDITOR: ""
- HOME: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpJec4ml
+ HOME: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpmm81Ut
LANG: C
LC_ALL: C
SOURCE_DATE_EPOCH: "1704067200"
@@ -22,7 +22,7 @@ success: true
exit_code: 0
----- stdout -----
βœ… Created new worktree for feature
- Path: [REPO].feature
+ Path: [REPO]/../test-repo.feature
To enable automatic cd, run: wt configure-shell
diff --git a/tests/snapshots/integration__integration_tests__post_start_commands__post_start_multiple_background.snap b/tests/snapshots/integration__integration_tests__post_start_commands__post_start_multiple_background.snap
index 0040d16e5..348140588 100644
--- a/tests/snapshots/integration__integration_tests__post_start_commands__post_start_multiple_background.snap
+++ b/tests/snapshots/integration__integration_tests__post_start_commands__post_start_multiple_background.snap
@@ -13,7 +13,7 @@ info:
GIT_CONFIG_GLOBAL: /dev/null
GIT_CONFIG_SYSTEM: /dev/null
GIT_EDITOR: ""
- HOME: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpdjrX9R
+ HOME: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpsJq5hm
LANG: C
LC_ALL: C
SOURCE_DATE_EPOCH: "1704067200"
@@ -22,7 +22,7 @@ success: true
exit_code: 0
----- stdout -----
βœ… Created new worktree for feature
- Path: [REPO].feature
+ Path: [REPO]/../test-repo.feature
To enable automatic cd, run: wt configure-shell
diff --git a/tests/snapshots/integration__integration_tests__post_start_commands__post_start_separate_logs.snap b/tests/snapshots/integration__integration_tests__post_start_commands__post_start_separate_logs.snap
index 087940738..72133a89c 100644
--- a/tests/snapshots/integration__integration_tests__post_start_commands__post_start_separate_logs.snap
+++ b/tests/snapshots/integration__integration_tests__post_start_commands__post_start_separate_logs.snap
@@ -13,7 +13,7 @@ info:
GIT_CONFIG_GLOBAL: /dev/null
GIT_CONFIG_SYSTEM: /dev/null
GIT_EDITOR: ""
- HOME: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpwYI79g
+ HOME: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpsJ7hwP
LANG: C
LC_ALL: C
SOURCE_DATE_EPOCH: "1704067200"
@@ -22,7 +22,7 @@ success: true
exit_code: 0
----- stdout -----
βœ… Created new worktree for feature
- Path: [REPO].feature
+ Path: [REPO]/../test-repo.feature
To enable automatic cd, run: wt configure-shell
diff --git a/tests/snapshots/integration__integration_tests__post_start_commands__post_start_single_background.snap b/tests/snapshots/integration__integration_tests__post_start_commands__post_start_single_background.snap
index ed160967f..85b9c71d4 100644
--- a/tests/snapshots/integration__integration_tests__post_start_commands__post_start_single_background.snap
+++ b/tests/snapshots/integration__integration_tests__post_start_commands__post_start_single_background.snap
@@ -13,7 +13,7 @@ info:
GIT_CONFIG_GLOBAL: /dev/null
GIT_CONFIG_SYSTEM: /dev/null
GIT_EDITOR: ""
- HOME: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpevdKIc
+ HOME: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpeoYZa6
LANG: C
LC_ALL: C
SOURCE_DATE_EPOCH: "1704067200"
@@ -22,7 +22,7 @@ success: true
exit_code: 0
----- stdout -----
βœ… Created new worktree for feature
- Path: [REPO].feature
+ Path: [REPO]/../test-repo.feature
To enable automatic cd, run: wt configure-shell
diff --git a/tests/snapshots/integration__integration_tests__spacing_edge_cases__alignment_empty_diffs.snap b/tests/snapshots/integration__integration_tests__spacing_edge_cases__alignment_empty_diffs.snap
index ff424a849..c60162b57 100644
--- a/tests/snapshots/integration__integration_tests__spacing_edge_cases__alignment_empty_diffs.snap
+++ b/tests/snapshots/integration__integration_tests__spacing_edge_cases__alignment_empty_diffs.snap
@@ -20,7 +20,7 @@ success: true
exit_code: 0
----- stdout -----
Branch  Age  WT +/- Commit  Message  Path
-main  9 months ago b834638e Initial commit ./main
+main  9 months ago b834638e Initial commit ./test-repo
also-no-changes 9 months ago b834638e Initial commit ./also-no-changes
no-changes 9 months ago b834638e Initial commit ./no-changes
with-changes 9 months ago +1 -1 b834638e Initial commit ./with-changes
diff --git a/tests/snapshots/integration__integration_tests__spacing_edge_cases__alignment_extreme_diffs.snap b/tests/snapshots/integration__integration_tests__spacing_edge_cases__alignment_extreme_diffs.snap
index 15ccd7167..0f5afa4e3 100644
--- a/tests/snapshots/integration__integration_tests__spacing_edge_cases__alignment_extreme_diffs.snap
+++ b/tests/snapshots/integration__integration_tests__spacing_edge_cases__alignment_extreme_diffs.snap
@@ -20,7 +20,7 @@ success: true
exit_code: 0
----- stdout -----
Branch Age  WT +/- Commit  Message  Path
-main  9 months ago b834638e Initial commit ./main
+main  9 months ago b834638e Initial commit ./test-repo
huge 9 months ago b834638e Initial commit ./huge
tiny 9 months ago +1 -1 b834638e Initial commit ./tiny
diff --git a/tests/snapshots/integration__integration_tests__spacing_edge_cases__alignment_varying_diffs.snap b/tests/snapshots/integration__integration_tests__spacing_edge_cases__alignment_varying_diffs.snap
index f64b37d05..08d925d7d 100644
--- a/tests/snapshots/integration__integration_tests__spacing_edge_cases__alignment_varying_diffs.snap
+++ b/tests/snapshots/integration__integration_tests__spacing_edge_cases__alignment_varying_diffs.snap
@@ -20,7 +20,7 @@ success: true
exit_code: 0
----- stdout -----
Branch  Age  Commit  Message  Path
-main  9 months ago b834638e Initial commit ./main
+main  9 months ago b834638e Initial commit ./test-repo
feature-large 9 months ago b834638e Initial commit ./feature-large
feature-medium 9 months ago b834638e Initial commit ./feature-medium
feature-small 9 months ago b834638e Initial commit ./feature-small
diff --git a/tests/snapshots/integration__integration_tests__spacing_edge_cases__long_branch_names.snap b/tests/snapshots/integration__integration_tests__spacing_edge_cases__long_branch_names.snap
index 46f1e4c6f..536766115 100644
--- a/tests/snapshots/integration__integration_tests__spacing_edge_cases__long_branch_names.snap
+++ b/tests/snapshots/integration__integration_tests__spacing_edge_cases__long_branch_names.snap
@@ -19,7 +19,7 @@ success: true
exit_code: 0
----- stdout -----
Branch  Commit  Path
-main  b834638e ./main
+main  b834638e ./test-repo
another-extremely-long-name-here b834638e ./another-extremely-long-name-here
short b834638e ./short
very-long-feature-branch-name b834638e ./very-long-feature-branch-name
diff --git a/tests/snapshots/integration__integration_tests__spacing_edge_cases__mixed_length_branch_names.snap b/tests/snapshots/integration__integration_tests__spacing_edge_cases__mixed_length_branch_names.snap
index 411d236f9..87fc059f8 100644
--- a/tests/snapshots/integration__integration_tests__spacing_edge_cases__mixed_length_branch_names.snap
+++ b/tests/snapshots/integration__integration_tests__spacing_edge_cases__mixed_length_branch_names.snap
@@ -19,7 +19,7 @@ success: true
exit_code: 0
----- stdout -----
Branch Commit  Path
-main  b834638e ./main
+main  b834638e ./test-repo
long b834638e ./extremely-long-branch-name-that-might-cause-layout-issues
medium b834638e ./medium-length-name
x b834638e ./x
diff --git a/tests/snapshots/integration__integration_tests__spacing_edge_cases__short_branch_names.snap b/tests/snapshots/integration__integration_tests__spacing_edge_cases__short_branch_names.snap
index 48c9f6de3..4c7ed988d 100644
--- a/tests/snapshots/integration__integration_tests__spacing_edge_cases__short_branch_names.snap
+++ b/tests/snapshots/integration__integration_tests__spacing_edge_cases__short_branch_names.snap
@@ -19,7 +19,7 @@ success: true
exit_code: 0
----- stdout -----
Branch Age  Commit  Message  Path
-main  9 months ago b834638e Initial commit ./main
+main  9 months ago b834638e Initial commit ./test-repo
a 9 months ago b834638e Initial commit ./a
bb 9 months ago b834638e Initial commit ./bb
ccc 9 months ago b834638e Initial commit ./ccc
diff --git a/tests/snapshots/integration__integration_tests__spacing_edge_cases__terminal_width_120.snap b/tests/snapshots/integration__integration_tests__spacing_edge_cases__terminal_width_120.snap
index 47e8a66af..481f3afd7 100644
--- a/tests/snapshots/integration__integration_tests__spacing_edge_cases__terminal_width_120.snap
+++ b/tests/snapshots/integration__integration_tests__spacing_edge_cases__terminal_width_120.snap
@@ -20,7 +20,7 @@ success: true
exit_code: 0
----- stdout -----
Branch  Age  Commit  Message  Path
-main  9 months ago a7bc47ca Initial commit with a reasonably long message ./main
+main  9 months ago a7bc47ca Initial commit with a reasonably long message ./test-repo
feature-a 9 months ago a7bc47ca Initial commit with a reasonably long message ./feature-a
feature-b 9 months ago a7bc47ca Initial commit with a reasonably long message ./feature-b
diff --git a/tests/snapshots/integration__integration_tests__spacing_edge_cases__terminal_width_150.snap b/tests/snapshots/integration__integration_tests__spacing_edge_cases__terminal_width_150.snap
index 543501a0c..4cebf9fa9 100644
--- a/tests/snapshots/integration__integration_tests__spacing_edge_cases__terminal_width_150.snap
+++ b/tests/snapshots/integration__integration_tests__spacing_edge_cases__terminal_width_150.snap
@@ -20,7 +20,7 @@ success: true
exit_code: 0
----- stdout -----
Branch  Age  Commit  Message  Path
-main  9 months ago a7bc47ca Initial commit with a reasonably long message ./main
+main  9 months ago a7bc47ca Initial commit with a reasonably long message ./test-repo
feature-a 9 months ago a7bc47ca Initial commit with a reasonably long message ./feature-a
feature-b 9 months ago a7bc47ca Initial commit with a reasonably long message ./feature-b
diff --git a/tests/snapshots/integration__integration_tests__spacing_edge_cases__terminal_width_80.snap b/tests/snapshots/integration__integration_tests__spacing_edge_cases__terminal_width_80.snap
index 270dccfe0..22802baae 100644
--- a/tests/snapshots/integration__integration_tests__spacing_edge_cases__terminal_width_80.snap
+++ b/tests/snapshots/integration__integration_tests__spacing_edge_cases__terminal_width_80.snap
@@ -20,7 +20,7 @@ success: true
exit_code: 0
----- stdout -----
Branch  Age  Commit  Message  Path
-main  9 months ago a7bc47ca Initial commit with a... ./main
+main  9 months ago a7bc47ca Initial commit with a... ./test-repo
feature-a 9 months ago a7bc47ca Initial commit with a... ./feature-a
feature-b 9 months ago a7bc47ca Initial commit with a... ./feature-b
diff --git a/tests/snapshots/integration__integration_tests__spacing_edge_cases__unicode_branch_names.snap b/tests/snapshots/integration__integration_tests__spacing_edge_cases__unicode_branch_names.snap
index bbf056d53..ff6d67660 100644
--- a/tests/snapshots/integration__integration_tests__spacing_edge_cases__unicode_branch_names.snap
+++ b/tests/snapshots/integration__integration_tests__spacing_edge_cases__unicode_branch_names.snap
@@ -19,7 +19,7 @@ success: true
exit_code: 0
----- stdout -----
Branch Age  Commit  Message  Path
-main  9 months ago b834638e Initial commit ./main
+main  9 months ago b834638e Initial commit ./test-repo
cafe 9 months ago b834638e Initial commit ./cafΓ©
naive 9 months ago b834638e Initial commit ./naΓ―ve
resume 9 months ago b834638e Initial commit ./rΓ©sumΓ©
diff --git a/tests/snapshots/integration__integration_tests__switch__switch_create_new.snap b/tests/snapshots/integration__integration_tests__switch__switch_create_new.snap
index bcc9a2884..9d2df18be 100644
--- a/tests/snapshots/integration__integration_tests__switch__switch_create_new.snap
+++ b/tests/snapshots/integration__integration_tests__switch__switch_create_new.snap
@@ -21,7 +21,7 @@ success: true
exit_code: 0
----- stdout -----
βœ… Created new worktree for feature-x
- Path: [REPO].feature-x
+ Path: [REPO]/../test-repo.feature-x
To enable automatic cd, run: wt configure-shell
diff --git a/tests/snapshots/integration__integration_tests__switch__switch_execute_creates_file.snap b/tests/snapshots/integration__integration_tests__switch__switch_execute_creates_file.snap
index 6641981c7..9674fdc59 100644
--- a/tests/snapshots/integration__integration_tests__switch__switch_execute_creates_file.snap
+++ b/tests/snapshots/integration__integration_tests__switch__switch_execute_creates_file.snap
@@ -23,7 +23,7 @@ success: true
exit_code: 0
----- stdout -----
βœ… Created new worktree for file-test
- Path: [REPO].file-test
+ Path: [REPO]/../test-repo.file-test
----- stderr -----
diff --git a/tests/snapshots/integration__integration_tests__switch__switch_execute_failure.snap b/tests/snapshots/integration__integration_tests__switch__switch_execute_failure.snap
index 88f0be6c4..1b4998f34 100644
--- a/tests/snapshots/integration__integration_tests__switch__switch_execute_failure.snap
+++ b/tests/snapshots/integration__integration_tests__switch__switch_execute_failure.snap
@@ -23,7 +23,7 @@ success: false
exit_code: 1
----- stdout -----
βœ… Created new worktree for fail-test
- Path: [REPO].fail-test
+ Path: [REPO]/../test-repo.fail-test
----- stderr -----
diff --git a/tests/snapshots/integration__integration_tests__switch__switch_execute_multiline.snap b/tests/snapshots/integration__integration_tests__switch__switch_execute_multiline.snap
index 79b57c68e..adb5ba753 100644
--- a/tests/snapshots/integration__integration_tests__switch__switch_execute_multiline.snap
+++ b/tests/snapshots/integration__integration_tests__switch__switch_execute_multiline.snap
@@ -23,7 +23,7 @@ success: true
exit_code: 0
----- stdout -----
βœ… Created new worktree for multiline-test
- Path: [REPO].multiline-test
+ Path: [REPO]/../test-repo.multiline-test
line1
line2
diff --git a/tests/snapshots/integration__integration_tests__switch__switch_execute_success.snap b/tests/snapshots/integration__integration_tests__switch__switch_execute_success.snap
index 6d7e1a7db..58c8e94ee 100644
--- a/tests/snapshots/integration__integration_tests__switch__switch_execute_success.snap
+++ b/tests/snapshots/integration__integration_tests__switch__switch_execute_success.snap
@@ -23,7 +23,7 @@ success: true
exit_code: 0
----- stdout -----
βœ… Created new worktree for exec-test
- Path: [REPO].exec-test
+ Path: [REPO]/../test-repo.exec-test
test output
diff --git a/tests/snapshots/integration__integration_tests__switch__switch_internal_mode.snap b/tests/snapshots/integration__integration_tests__switch__switch_internal_mode.snap
index a2fcb0a37..0f0265750 100644
Binary files a/tests/snapshots/integration__integration_tests__switch__switch_internal_mode.snap and b/tests/snapshots/integration__integration_tests__switch__switch_internal_mode.snap differ
diff --git a/tests/snapshots/integration__integration_tests__switch__switch_internal_with_execute.snap b/tests/snapshots/integration__integration_tests__switch__switch_internal_with_execute.snap
index 60c0b09e8..6fff1ab96 100644
Binary files a/tests/snapshots/integration__integration_tests__switch__switch_internal_with_execute.snap and b/tests/snapshots/integration__integration_tests__switch__switch_internal_with_execute.snap differ
diff --git a/tests/snapshots/integration__integration_tests__switch__switch_no_config_commands_execute_still_runs.snap b/tests/snapshots/integration__integration_tests__switch__switch_no_config_commands_execute_still_runs.snap
index 6880b2f10..c43b23987 100644
--- a/tests/snapshots/integration__integration_tests__switch__switch_no_config_commands_execute_still_runs.snap
+++ b/tests/snapshots/integration__integration_tests__switch__switch_no_config_commands_execute_still_runs.snap
@@ -24,7 +24,7 @@ success: true
exit_code: 0
----- stdout -----
βœ… Created new worktree for no-config-commands-test
- Path: [REPO].no-config-commands-test
+ Path: [REPO]/../test-repo.no-config-commands-test
execute command runs
diff --git a/tests/snapshots/integration__integration_tests__switch__switch_no_config_commands_skips_post_start.snap b/tests/snapshots/integration__integration_tests__switch__switch_no_config_commands_skips_post_start.snap
index 672cd0ec3..110238d4b 100644
--- a/tests/snapshots/integration__integration_tests__switch__switch_no_config_commands_skips_post_start.snap
+++ b/tests/snapshots/integration__integration_tests__switch__switch_no_config_commands_skips_post_start.snap
@@ -14,7 +14,7 @@ info:
GIT_CONFIG_GLOBAL: /dev/null
GIT_CONFIG_SYSTEM: /dev/null
GIT_EDITOR: ""
- HOME: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpBQEtm6
+ HOME: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpqatjYg
LANG: C
LC_ALL: C
SOURCE_DATE_EPOCH: "1704067200"
@@ -23,7 +23,7 @@ success: true
exit_code: 0
----- stdout -----
βœ… Created new worktree for no-post-start
- Path: [REPO].no-post-start
+ Path: [REPO]/../test-repo.no-post-start
To enable automatic cd, run: wt configure-shell
diff --git a/tests/snapshots/integration__integration_tests__switch__switch_no_config_commands_with_force.snap b/tests/snapshots/integration__integration_tests__switch__switch_no_config_commands_with_force.snap
index 891252fdf..5e9410378 100644
--- a/tests/snapshots/integration__integration_tests__switch__switch_no_config_commands_with_force.snap
+++ b/tests/snapshots/integration__integration_tests__switch__switch_no_config_commands_with_force.snap
@@ -15,7 +15,7 @@ info:
GIT_CONFIG_GLOBAL: /dev/null
GIT_CONFIG_SYSTEM: /dev/null
GIT_EDITOR: ""
- HOME: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpZHsoXp
+ HOME: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpD3ng3v
LANG: C
LC_ALL: C
SOURCE_DATE_EPOCH: "1704067200"
@@ -24,7 +24,7 @@ success: true
exit_code: 0
----- stdout -----
βœ… Created new worktree for force-no-config-commands
- Path: [REPO].force-no-config-commands
+ Path: [REPO]/../test-repo.force-no-config-commands
To enable automatic cd, run: wt configure-shell
diff --git a/tests/snapshots/integration__integration_tests__switch__switch_with_base.snap b/tests/snapshots/integration__integration_tests__switch__switch_with_base.snap
index 735428af2..d46e5d63e 100644
--- a/tests/snapshots/integration__integration_tests__switch__switch_with_base.snap
+++ b/tests/snapshots/integration__integration_tests__switch__switch_with_base.snap
@@ -23,7 +23,7 @@ success: true
exit_code: 0
----- stdout -----
βœ… Created new worktree for feature-with-base
- Path: [REPO].feature-with-base
+ Path: [REPO]/../test-repo.feature-with-base
To enable automatic cd, run: wt configure-shell