Worktrunk is a CLI for Git worktree management, designed for parallel AI agent workflows
Refactor: Remove `--internal` flag from commands
Maximilian Roos182cf5ca66be
diff --git a/src/commands/merge.rs b/src/commands/merge.rsindex 2b834bf5f..427df27b6 100644--- a/src/commands/merge.rs+++ b/src/commands/merge.rs@@ -17,7 +17,6 @@ pub fn handle_merge(message: Option<&str>,no_verify: bool,force: bool,- internal: bool,) -> Result<(), GitError> {let repo = Repository::current();@@ -62,7 +61,6 @@ pub fn handle_merge(&repo,&config,force,- internal,)?;}@@ -71,26 +69,26 @@ pub fn handle_merge(// Squash commits if requestedif squash {- squashed_count = handle_squash(&target_branch, internal)?;+ squashed_count = handle_squash(&target_branch)?;}// Rebase onto target- if !internal {- println!("π {CYAN}Rebasing onto {CYAN_BOLD}{target_branch}{CYAN_BOLD:#}...{CYAN:#}");- }+ crate::output::progress(format!(+ "π {CYAN}Rebasing onto {CYAN_BOLD}{target_branch}{CYAN_BOLD:#}...{CYAN:#}"+ ))+ .map_err(|e| GitError::CommandFailed(e.to_string()))?;repo.run_command(&["rebase", &target_branch]).map_err(|e| {GitError::CommandFailed(format!("Failed to rebase onto '{}': {}", target_branch, e))})?;// Fast-forward push to target branch (reuse handle_push logic)- handle_push(Some(&target_branch), false, internal)?;+ handle_push(Some(&target_branch), false)?;// Finish worktree unless --keep was specifiedif !keep {- if !internal {- println!("π {CYAN}Cleaning up worktree...{CYAN:#}");- }+ crate::output::progress(format!("π {CYAN}Cleaning up worktree...{CYAN:#}"))+ .map_err(|e| GitError::CommandFailed(e.to_string()))?;// Get primary worktree path before finishing (while we can still run git commands)let primary_worktree_dir = repo.main_worktree_root()?;@@ -104,11 +102,10 @@ pub fn handle_merge(let primary_repo = Repository::at(&primary_worktree_dir);let new_branch = primary_repo.current_branch()?;if new_branch.as_deref() != Some(&target_branch) {- if !internal {- println!(- "π {CYAN}Switching to {CYAN_BOLD}{target_branch}{CYAN_BOLD:#}...{CYAN:#}"- );- }+ crate::output::progress(format!(+ "π {CYAN}Switching to {CYAN_BOLD}{target_branch}{CYAN_BOLD:#}...{CYAN:#}"+ ))+ .map_err(|e| GitError::CommandFailed(e.to_string()))?;primary_repo.run_command(&["switch", &target_branch]).map_err(|e| {@@ -218,7 +215,7 @@ fn handle_commit_changes(Ok(())}-fn handle_squash(target_branch: &str, internal: bool) -> Result<Option<usize>, GitError> {+fn handle_squash(target_branch: &str) -> Result<Option<usize>, GitError> {let repo = Repository::current();// Get merge base with target branch@@ -233,10 +230,11 @@ fn handle_squash(target_branch: &str, internal: bool) -> Result<Option<usize>, G// Handle different scenariosif commit_count == 0 && !has_staged {// No commits and no staged changes - nothing to squash- if !internal {- let dim = AnstyleStyle::new().dimmed();- println!("{dim}No commits to squash - already at merge base{dim:#}");- }+ let dim = AnstyleStyle::new().dimmed();+ crate::output::progress(format!(+ "{dim}No commits to squash - already at merge base{dim:#}"+ ))+ .map_err(|e| GitError::CommandFailed(e.to_string()))?;return Ok(None);}@@ -250,19 +248,19 @@ fn handle_squash(target_branch: &str, internal: bool) -> Result<Option<usize>, Gif commit_count == 1 && !has_staged {// Single commit, no staged changes - nothing to do- if !internal {- let dim = AnstyleStyle::new().dimmed();- println!(- "{dim}Only 1 commit since {CYAN_BOLD}{target_branch}{CYAN_BOLD:#} - no squashing needed{dim:#}"- );- }+ let dim = AnstyleStyle::new().dimmed();+ crate::output::progress(format!(+ "{dim}Only 1 commit since {CYAN_BOLD}{target_branch}{CYAN_BOLD:#} - no squashing needed{dim:#}"+ ))+ .map_err(|e| GitError::CommandFailed(e.to_string()))?;return Ok(None);}// One or more commits (possibly with staged changes) - squash them- if !internal {- println!("π {CYAN}Squashing {commit_count} commits into one...{CYAN:#}");- }+ crate::output::progress(format!(+ "π {CYAN}Squashing {commit_count} commits into one...{CYAN:#}"+ ))+ .map_err(|e| GitError::CommandFailed(e.to_string()))?;// Get commit subjects for the squash messagelet range = format!("{}..HEAD", merge_base);@@ -285,9 +283,10 @@ fn handle_squash(target_branch: &str, internal: bool) -> Result<Option<usize>, Grepo.run_command(&["commit", "-m", &commit_message]).map_err(|e| GitError::CommandFailed(format!("Failed to create squash commit: {}", e)))?;- if !internal {- println!("β {GREEN}Squashed {commit_count} commits into one{GREEN:#}");- }+ crate::output::progress(format!(+ "β {GREEN}Squashed {commit_count} commits into one{GREEN:#}"+ ))+ .map_err(|e| GitError::CommandFailed(e.to_string()))?;Ok(Some(commit_count))}@@ -300,7 +299,6 @@ fn run_pre_merge_checks(repo: &Repository,config: &WorktrunkConfig,force: bool,- internal: bool,) -> Result<(), GitError> {let Some(pre_merge_config) = &project_config.pre_merge_check else {return Ok(());@@ -320,14 +318,11 @@ fn run_pre_merge_checks(},)?;for prepared in commands {- if !internal {- use std::io::Write;- println!(- "π {CYAN}Running pre-merge check '{name}'...{CYAN:#}",- name = prepared.name- );- let _ = std::io::stdout().flush();- }+ crate::output::progress(format!(+ "π {CYAN}Running pre-merge check '{name}'...{CYAN:#}",+ name = prepared.name+ ))+ .map_err(|e| GitError::CommandFailed(e.to_string()))?;if let Err(e) = execute_command_in_worktree(worktree_path, &prepared.expanded) {eprintln!();diff --git a/src/commands/worktree.rs b/src/commands/worktree.rsindex 827ac4960..8752c08d5 100644--- a/src/commands/worktree.rs+++ b/src/commands/worktree.rs@@ -536,11 +536,7 @@ fn spawn_post_start_commands(Ok(())}-pub fn handle_push(- target: Option<&str>,- allow_merge_commits: bool,- internal: bool,-) -> Result<(), GitError> {+pub fn handle_push(target: Option<&str>, allow_merge_commits: bool) -> Result<(), GitError> {let repo = Repository::current();// Get target branch (default to default branch if not provided)@@ -590,7 +586,7 @@ pub fn handle_push(String::new()};- if commit_count > 0 && !internal {+ if commit_count > 0 {let commit_text = if commit_count == 1 {"commit"} else {@@ -599,10 +595,10 @@ pub fn handle_push(let head_sha = repo.run_command(&["rev-parse", "--short", "HEAD"])?;let head_sha = head_sha.trim();- println!(- "π {CYAN}Pushing {commit_count} {commit_text} to {CYAN_BOLD}{target_branch}{CYAN_BOLD:#} @ {head_sha}{CYAN:#}"- );- println!();+ crate::output::progress(format!(+ "π {CYAN}Pushing {commit_count} {commit_text} to {CYAN_BOLD}{target_branch}{CYAN_BOLD:#} @ {head_sha}{CYAN:#}\n"+ ))+ .map_err(|e| GitError::CommandFailed(e.to_string()))?;// Show the commit graph with colorlet log_output = repo.run_command(&[@@ -613,8 +609,8 @@ pub fn handle_push("--decorate",&format!("{}..HEAD", target_branch),])?;- println!("{}", log_output.trim());- println!();+ crate::output::progress(format!("{}\n", log_output.trim()))+ .map_err(|e| GitError::CommandFailed(e.to_string()))?;// Show diff statistics with colorlet diff_stat = repo.run_command(&[@@ -626,8 +622,8 @@ pub fn handle_push(let diff_stat = diff_stat.trim_end();if !diff_stat.is_empty() {- println!("{}", diff_stat);- println!();+ crate::output::progress(format!("{}\n", diff_stat))+ .map_err(|e| GitError::CommandFailed(e.to_string()))?;}}@@ -642,39 +638,41 @@ pub fn handle_push(})?;// Build success message with statistics- if !internal {- if commit_count > 0 {- // Parse shortstat to extract files/insertions/deletions- // Example: " 3 files changed, 45 insertions(+), 12 deletions(-)"- let stats = parse_diff_shortstat(&diff_shortstat);-- let mut summary_parts = vec![format!(- "{} commit{}",- commit_count,- if commit_count == 1 { "" } else { "s" }- )];-- if let Some(files) = stats.files {- summary_parts.push(format!(- "{} file{}",- files,- if files == 1 { "" } else { "s" }- ));- }- if let Some(insertions) = stats.insertions {- summary_parts.push(format!("{ADDITION}+{insertions}{ADDITION:#}"));- }- if let Some(deletions) = stats.deletions {- summary_parts.push(format!("{DELETION}-{deletions}{DELETION:#}"));- }-- println!(- "β {GREEN}Pushed to {GREEN_BOLD}{target_branch}{GREEN_BOLD:#} ({}) {GREEN:#}",- summary_parts.join(", ")- );- } else {- println!("β {GREEN}Pushed to {GREEN_BOLD}{target_branch}{GREEN_BOLD:#}{GREEN:#}");+ if commit_count > 0 {+ // Parse shortstat to extract files/insertions/deletions+ // Example: " 3 files changed, 45 insertions(+), 12 deletions(-)"+ let stats = parse_diff_shortstat(&diff_shortstat);++ let mut summary_parts = vec![format!(+ "{} commit{}",+ commit_count,+ if commit_count == 1 { "" } else { "s" }+ )];++ if let Some(files) = stats.files {+ summary_parts.push(format!(+ "{} file{}",+ files,+ if files == 1 { "" } else { "s" }+ ));+ }+ if let Some(insertions) = stats.insertions {+ summary_parts.push(format!("{ADDITION}+{insertions}{ADDITION:#}"));}+ if let Some(deletions) = stats.deletions {+ summary_parts.push(format!("{DELETION}-{deletions}{DELETION:#}"));+ }++ crate::output::progress(format!(+ "β {GREEN}Pushed to {GREEN_BOLD}{target_branch}{GREEN_BOLD:#} ({}) {GREEN:#}",+ summary_parts.join(", ")+ ))+ .map_err(|e| GitError::CommandFailed(e.to_string()))?;+ } else {+ crate::output::progress(format!(+ "β {GREEN}Pushed to {GREEN_BOLD}{target_branch}{GREEN_BOLD:#}{GREEN:#}"+ ))+ .map_err(|e| GitError::CommandFailed(e.to_string()))?;}Ok(())diff --git a/src/main.rs b/src/main.rsindex a2f2d5590..1706846ca 100644--- a/src/main.rs+++ b/src/main.rs@@ -35,6 +35,10 @@ struct Cli {#[arg(long, short = 'v', global = true)]verbose: bool,+ /// Use internal mode (outputs directives for shell wrapper)+ #[arg(long, global = true, hide = true)]+ internal: bool,+#[command(subcommand)]command: Commands,}@@ -115,20 +119,12 @@ enum Commands {/// Skip executing post-start commands from project config#[arg(long)]no_config_commands: bool,-- /// Use internal mode (outputs directives for shell wrapper)- #[arg(long, hide = true)]- internal: bool,},/// Finish current worktree, returning to primary if currentRemove {/// Worktree name or branch to remove (defaults to current worktree)worktree: Option<String>,-- /// Use internal mode (outputs directives for shell wrapper)- #[arg(long, hide = true)]- internal: bool,},/// Push changes between worktrees@@ -165,10 +161,6 @@ enum Commands {/// Skip approval prompts for commands#[arg(short, long)]force: bool,-- /// Use internal mode (outputs directives for shell wrapper)- #[arg(long, hide = true)]- internal: bool,},/// Generate shell completion script (deprecated - use init instead)@@ -191,6 +183,14 @@ enum Commands {fn main() {let cli = Cli::parse();+ // Initialize output context based on --internal flag+ let output_mode = if cli.internal {+ output::OutputMode::Directive+ } else {+ output::OutputMode::Interactive+ };+ output::initialize(output_mode);+// Configure logging based on --verbose flag or RUST_LOG env varenv_logger::Builder::from_env(env_logger::Env::default().default_filter_or(if cli.verbose { "debug" } else { "off" }),@@ -311,45 +311,26 @@ fn main() {execute,force,no_config_commands,- internal,- } => {- // Initialize output context based on mode- let output_mode = if internal {- output::OutputMode::Directive- } else {- output::OutputMode::Interactive- };- output::initialize(output_mode);-- WorktrunkConfig::load()- .map_err(|e| GitError::CommandFailed(format!("Failed to load config: {}", e)))- .and_then(|config| {- handle_switch(- &branch,- create,- base.as_deref(),- force,- no_config_commands,- &config,- )- .and_then(|result| handle_switch_output(&result, &branch, execute.as_deref()))- })- }- Commands::Remove { worktree, internal } => {- // Initialize output context based on mode- let output_mode = if internal {- output::OutputMode::Directive- } else {- output::OutputMode::Interactive- };- output::initialize(output_mode);-+ } => WorktrunkConfig::load()+ .map_err(|e| GitError::CommandFailed(format!("Failed to load config: {}", e)))+ .and_then(|config| {+ handle_switch(+ &branch,+ create,+ base.as_deref(),+ force,+ no_config_commands,+ &config,+ )+ .and_then(|result| handle_switch_output(&result, &branch, execute.as_deref()))+ }),+ Commands::Remove { worktree } => {handle_remove(worktree.as_deref()).and_then(|result| handle_remove_output(&result))}Commands::Push {target,allow_merge_commits,- } => handle_push(target.as_deref(), allow_merge_commits, false),+ } => handle_push(target.as_deref(), allow_merge_commits),Commands::Merge {target,squash,@@ -357,26 +338,14 @@ fn main() {message,no_verify,force,- internal,- } => {- // Initialize output context based on mode- let output_mode = if internal {- output::OutputMode::Directive- } else {- output::OutputMode::Interactive- };- output::initialize(output_mode);-- handle_merge(- target.as_deref(),- squash,- keep,- message.as_deref(),- no_verify,- force,- internal,- )- }+ } => handle_merge(+ target.as_deref(),+ squash,+ keep,+ message.as_deref(),+ no_verify,+ force,+ ),Commands::Completion { shell } => {let mut cli_cmd = Cli::command();handle_completion(shell, &mut cli_cmd);diff --git a/src/output/directive.rs b/src/output/directive.rsindex b431b9362..4952c8ac3 100644--- a/src/output/directive.rs+++ b/src/output/directive.rs@@ -24,6 +24,11 @@ impl DirectiveOutput {io::stdout().flush()}+ pub fn progress(&mut self, _message: String) -> io::Result<()> {+ // Progress messages are only for humans - suppress in directive mode+ Ok(())+ }+pub fn change_directory(&mut self, path: &Path) -> io::Result<()> {// Ensure any prior stderr output is NUL-terminated before writing directive// The shell wrapper merges stderr+stdout via 2>&1 and splits on NUL bytes,diff --git a/src/output/global.rs b/src/output/global.rsindex 9ec74522a..785960554 100644--- a/src/output/global.rs+++ b/src/output/global.rs@@ -68,6 +68,20 @@ pub fn success(message: impl Into<String>) -> io::Result<()> {})}+/// Emit a progress message (only shown in interactive mode)+///+/// Progress messages are intermediate status updates like "π Cleaning up worktree..."+/// They are shown to human users but suppressed in directive mode (shell integration).+pub fn progress(message: impl Into<String>) -> io::Result<()> {+ OUTPUT_CONTEXT.with(|ctx| {+ let msg = message.into();+ match &mut *ctx.borrow_mut() {+ OutputHandler::Interactive(i) => i.progress(msg),+ OutputHandler::Directive(d) => d.progress(msg),+ }+ })+}+/// Request directory change (for shell integration)pub fn change_directory(path: impl AsRef<Path>) -> io::Result<()> {OUTPUT_CONTEXT.with(|ctx| {diff --git a/src/output/handlers.rs b/src/output/handlers.rsindex f43b5b7ba..fe9f47f10 100644--- a/src/output/handlers.rs+++ b/src/output/handlers.rs@@ -78,11 +78,10 @@ pub fn handle_switch_output(// Execute command if providedif let Some(cmd) = execute {super::execute(cmd).map_err(|e| GitError::CommandFailed(e.to_string()))?;- } else if super::is_interactive() {- // No execute command in interactive mode: show shell integration hint- use worktrunk::styling::println;- println!();- println!("{}", shell_integration_hint());+ } else {+ // No execute command: show shell integration hint (only in interactive mode)+ super::progress(format!("\n{}", shell_integration_hint()))+ .map_err(|e| GitError::CommandFailed(e.to_string()))?;}// Flush output (important for directive mode)diff --git a/src/output/interactive.rs b/src/output/interactive.rsindex fe3fc97a8..357e63796 100644--- a/src/output/interactive.rs+++ b/src/output/interactive.rs@@ -23,6 +23,11 @@ impl InteractiveOutput {Ok(())}+ pub fn progress(&mut self, message: String) -> io::Result<()> {+ println!("{message}");+ Ok(())+ }+pub fn change_directory(&mut self, path: &Path) -> io::Result<()> {// In interactive mode, we can't actually change directory// Just store the target for execute commandsdiff --git a/src/output/mod.rs b/src/output/mod.rsindex 61bdb18dd..41d1e19dd 100644--- a/src/output/mod.rs+++ b/src/output/mod.rs@@ -63,7 +63,7 @@ pub mod interactive;// Re-export the public APIpub use global::{- OutputMode, change_directory, execute, flush, initialize, is_interactive, success,+ OutputMode, change_directory, execute, flush, initialize, is_interactive, progress, success,};// Re-export output handlersdiff --git a/templates/bash.sh b/templates/bash.shindex ced5b9683..ce127b9b6 100644--- a/templates/bash.sh+++ b/templates/bash.sh@@ -60,7 +60,7 @@ if command -v wt >/dev/null 2>&1; thenswitch|remove|merge)# Commands that need --internal for directory change supportshift- _wt_exec "$subcommand" --internal "$@"+ _wt_exec --internal "$subcommand" "$@";;*)# All other commands pass through directlydiff --git a/templates/elvish.elv b/templates/elvish.elvindex dc5479580..b4d8198e4 100644--- a/templates/elvish.elv+++ b/templates/elvish.elv@@ -65,7 +65,7 @@ if (has-external wt) {if (or (eq $subcommand "switch") (eq $subcommand "remove") (eq $subcommand "merge")) {# Commands that need --internal for directory change supportvar rest-args = $args[1..]- _wt_exec $subcommand --internal $@rest-args+ _wt_exec --internal $subcommand $@rest-args} else {# All other commands pass through directlye:$_WORKTRUNK_CMD $@argsdiff --git a/templates/fish.fish b/templates/fish.fishindex f2ee40843..95327dc92 100644--- a/templates/fish.fish+++ b/templates/fish.fish@@ -95,7 +95,7 @@ if type -q {{ cmd_prefix }}switch $subcommandcase switch remove merge# Commands that need --internal for directory change support- _wt_exec $subcommand --internal $argv[2..-1]+ _wt_exec --internal $subcommand $argv[2..-1]case '*'# All other commands pass through directlycommand $_WORKTRUNK_CMD $argvdiff --git a/templates/nushell.nu b/templates/nushell.nuindex f50973948..32b70ad68 100644--- a/templates/nushell.nu+++ b/templates/nushell.nu@@ -47,7 +47,7 @@ if (which wt | is-not-empty) {"switch" | "remove" | "merge" => {# Commands that need --internal for directory change supportlet rest_args = ($rest | skip 1)- let internal_args = ([$subcommand, "--internal"] | append $rest_args)+ let internal_args = (["--internal", $subcommand] | append $rest_args)let exit_code = (_wt_exec ...$internal_args)return $exit_code}diff --git a/templates/powershell.ps1 b/templates/powershell.ps1index e9e09c228..9e8dc615e 100644--- a/templates/powershell.ps1+++ b/templates/powershell.ps1@@ -63,7 +63,7 @@ if (Get-Command wt -ErrorAction SilentlyContinue) {{ $_ -in @("switch", "remove", "merge") } {# Commands that need --internal for directory change support$restArgs = $Arguments[1..($Arguments.Count-1)]- $exitCode = _wt_exec $subcommand --internal @restArgs+ $exitCode = _wt_exec --internal $subcommand @restArgsreturn $exitCode}default {diff --git a/templates/xonsh.xsh b/templates/xonsh.xshindex da031239b..6648d851e 100644--- a/templates/xonsh.xsh+++ b/templates/xonsh.xsh@@ -51,7 +51,7 @@ if shutil.which("wt") is not None:if subcommand in ["switch", "remove", "merge"]:# Commands that need --internal for directory change supportrest_args = args[1:]- return _wt_exec([subcommand, "--internal"] + rest_args)+ return _wt_exec(["--internal", subcommand] + rest_args)else:# All other commands pass through directlyresult = ![@(_WORKTRUNK_CMD) @(args)]diff --git a/tests/common/mod.rs b/tests/common/mod.rsindex 585efb71b..71637b041 100644--- a/tests/common/mod.rs+++ b/tests/common/mod.rs@@ -394,20 +394,42 @@ pub fn setup_snapshot_settings(repo: &TestRepo) -> insta::Settings {////// This extracts the common command setup while allowing the test file/// to call the macro with the correct module path for snapshot naming.-pub fn make_snapshot_cmd(+///+/// # Arguments+/// * `repo` - The test repository+/// * `subcommand` - The subcommand to run (e.g., "switch", "remove")+/// * `args` - Arguments to pass after the subcommand+/// * `cwd` - Optional working directory (defaults to repo root)+/// * `global_flags` - Optional global flags to pass before the subcommand (e.g., &["--internal"])+pub fn make_snapshot_cmd_with_global_flags(repo: &TestRepo,subcommand: &str,args: &[&str],cwd: Option<&Path>,+ global_flags: &[&str],) -> Command {let mut cmd = Command::new(insta_cmd::get_cargo_bin("wt"));repo.clean_cli_env(&mut cmd);- cmd.arg(subcommand)+ cmd.args(global_flags)+ .arg(subcommand).args(args).current_dir(cwd.unwrap_or(repo.root_path()));cmd}+/// Create a configured Command for snapshot testing+///+/// This extracts the common command setup while allowing the test file+/// to call the macro with the correct module path for snapshot naming.+pub fn make_snapshot_cmd(+ repo: &TestRepo,+ subcommand: &str,+ args: &[&str],+ cwd: Option<&Path>,+) -> Command {+ make_snapshot_cmd_with_global_flags(repo, subcommand, args, cwd, &[])+}+/// Resolve the actual git directory path from a worktree path////// In worktrees, `.git` is a file containing `gitdir: /path/to/git/dir`,diff --git a/tests/integration_tests/directives.rs b/tests/integration_tests/directives.rsindex fe7636b87..819ef7c9d 100644--- a/tests/integration_tests/directives.rs+++ b/tests/integration_tests/directives.rs@@ -18,9 +18,9 @@ fn test_switch_internal_directive() {settings.bind(|| {let mut cmd = Command::new(get_cargo_bin("wt"));repo.clean_cli_env(&mut cmd);- cmd.arg("switch")+ cmd.arg("--internal")+ .arg("switch").arg("my-feature")- .arg("--internal").current_dir(repo.root_path());assert_cmd_snapshot!("switch_internal_directive", cmd);@@ -62,8 +62,8 @@ fn test_remove_internal_directive() {settings.bind(|| {let mut cmd = Command::new(get_cargo_bin("wt"));repo.clean_cli_env(&mut cmd);- cmd.arg("remove")- .arg("--internal")+ cmd.arg("--internal")+ .arg("remove").current_dir(repo.root_path());assert_cmd_snapshot!("remove_internal_directive", cmd);@@ -131,10 +131,10 @@ fn test_merge_internal_keep() {settings.bind(|| {let mut cmd = Command::new(get_cargo_bin("wt"));repo.clean_cli_env(&mut cmd);- cmd.arg("merge")+ cmd.arg("--internal")+ .arg("merge").arg("main").arg("--keep")- .arg("--internal").current_dir(&feature_wt);assert_cmd_snapshot!("merge_internal_keep", cmd);diff --git a/tests/integration_tests/remove.rs b/tests/integration_tests/remove.rsindex 145b55cb2..894227a9d 100644--- a/tests/integration_tests/remove.rs+++ b/tests/integration_tests/remove.rs@@ -1,12 +1,23 @@-use crate::common::{TestRepo, make_snapshot_cmd, setup_snapshot_settings};+use crate::common::{TestRepo, make_snapshot_cmd_with_global_flags, setup_snapshot_settings};use insta_cmd::assert_cmd_snapshot;use std::process::Command;/// Helper to create snapshot with normalized pathsfn snapshot_remove(test_name: &str, repo: &TestRepo, args: &[&str], cwd: Option<&std::path::Path>) {+ snapshot_remove_with_global_flags(test_name, repo, args, cwd, &[]);+}++/// Helper to create snapshot with global flags (e.g., --internal)+fn snapshot_remove_with_global_flags(+ test_name: &str,+ repo: &TestRepo,+ args: &[&str],+ cwd: Option<&std::path::Path>,+ global_flags: &[&str],+) {let settings = setup_snapshot_settings(repo);settings.bind(|| {- let mut cmd = make_snapshot_cmd(repo, "remove", args, cwd);+ let mut cmd = make_snapshot_cmd_with_global_flags(repo, "remove", args, cwd, global_flags);assert_cmd_snapshot!(test_name, cmd);});}@@ -58,11 +69,12 @@ fn test_remove_internal_mode() {let worktree_path = repo.add_worktree("feature-internal", "feature-internal");- snapshot_remove(+ snapshot_remove_with_global_flags("remove_internal_mode",&repo,- &["--internal"],+ &[],Some(&worktree_path),+ &["--internal"],);}diff --git a/tests/integration_tests/switch.rs b/tests/integration_tests/switch.rsindex 01c481490..bc0b62749 100644--- a/tests/integration_tests/switch.rs+++ b/tests/integration_tests/switch.rs@@ -1,22 +1,33 @@-use crate::common::{TestRepo, make_snapshot_cmd, setup_snapshot_settings};+use crate::common::{TestRepo, make_snapshot_cmd_with_global_flags, setup_snapshot_settings};use insta_cmd::assert_cmd_snapshot;use std::path::Path;/// Helper to create snapshot with normalized paths and SHAsfn snapshot_switch(test_name: &str, repo: &TestRepo, args: &[&str]) {- snapshot_switch_with_home(test_name, repo, args, None);+ snapshot_switch_with_home(test_name, repo, args, None, &[]);}-/// Helper that also allows setting a custom HOME directory+/// Helper to create snapshot with global flags (e.g., --internal)+fn snapshot_switch_with_global_flags(+ test_name: &str,+ repo: &TestRepo,+ args: &[&str],+ global_flags: &[&str],+) {+ snapshot_switch_with_home(test_name, repo, args, None, global_flags);+}++/// Helper that also allows setting a custom HOME directory and global flagsfn snapshot_switch_with_home(test_name: &str,repo: &TestRepo,args: &[&str],temp_home: Option<&Path>,+ global_flags: &[&str],) {let settings = setup_snapshot_settings(repo);settings.bind(|| {- let mut cmd = make_snapshot_cmd(repo, "switch", args, None);+ let mut cmd = make_snapshot_cmd_with_global_flags(repo, "switch", args, None, global_flags);if let Some(home) = temp_home {cmd.env("HOME", home);}@@ -89,10 +100,11 @@ fn test_switch_internal_mode() {let repo = TestRepo::new();repo.commit("Initial commit");- snapshot_switch(+ snapshot_switch_with_global_flags("switch_internal_mode",&repo,- &["--create", "--internal", "internal-test"],+ &["--create", "internal-test"],+ &["--internal"],);}@@ -103,10 +115,11 @@ fn test_switch_existing_worktree_internal() {repo.add_worktree("existing-wt", "existing-wt");- snapshot_switch(+ snapshot_switch_with_global_flags("switch_existing_internal",&repo,- &["--internal", "existing-wt"],+ &["existing-wt"],+ &["--internal"],);}@@ -120,16 +133,11 @@ fn test_switch_internal_with_execute() {#[cfg(target_os = "windows")]let execute_cmd = "echo line1 && echo line2";- snapshot_switch(+ snapshot_switch_with_global_flags("switch_internal_with_execute",&repo,- &[- "--create",- "--internal",- "exec-internal",- "--execute",- execute_cmd,- ],+ &["--create", "exec-internal", "--execute", execute_cmd],+ &["--internal"],);}@@ -296,6 +304,7 @@ command = "{}"&repo,&["--create", "no-post-start", "--no-config-commands"],Some(temp_home.path()),+ &[],);}@@ -351,5 +360,6 @@ fn test_switch_no_config_commands_with_force() {"--no-config-commands",],Some(temp_home.path()),+ &[],);}diff --git a/tests/snapshots/integration__integration_tests__init__init_bash.snap b/tests/snapshots/integration__integration_tests__init__init_bash.snapindex c464c1ada..725539301 100644--- a/tests/snapshots/integration__integration_tests__init__init_bash.snap+++ b/tests/snapshots/integration__integration_tests__init__init_bash.snap@@ -81,7 +81,7 @@ if command -v wt >/dev/null 2>&1; thenswitch|remove|merge)# Commands that need --internal for directory change supportshift- _wt_exec "$subcommand" --internal "$@"+ _wt_exec --internal "$subcommand" "$@";;*)# All other commands pass through directlydiff --git a/tests/snapshots/integration__integration_tests__init__init_bash_custom_prefix.snap b/tests/snapshots/integration__integration_tests__init__init_bash_custom_prefix.snapindex 6f541f1a1..95b8a5333 100644--- a/tests/snapshots/integration__integration_tests__init__init_bash_custom_prefix.snap+++ b/tests/snapshots/integration__integration_tests__init__init_bash_custom_prefix.snap@@ -83,7 +83,7 @@ if command -v wt >/dev/null 2>&1; thenswitch|remove|merge)# Commands that need --internal for directory change supportshift- _wt_exec "$subcommand" --internal "$@"+ _wt_exec --internal "$subcommand" "$@";;*)# All other commands pass through directlydiff --git a/tests/snapshots/integration__integration_tests__init__init_fish.snap b/tests/snapshots/integration__integration_tests__init__init_fish.snapindex ddeb266a8..e267ad349 100644--- a/tests/snapshots/integration__integration_tests__init__init_fish.snap+++ b/tests/snapshots/integration__integration_tests__init__init_fish.snap@@ -116,7 +116,7 @@ if type -q wtswitch $subcommandcase switch remove merge# Commands that need --internal for directory change support- _wt_exec $subcommand --internal $argv[2..-1]+ _wt_exec --internal $subcommand $argv[2..-1]case '*'# All other commands pass through directlycommand $_WORKTRUNK_CMD $argv@@ -141,7 +141,7 @@ end# Static completions (commands and flags)# Print an optspec for argparse to handle cmd's options that are independent of any subcommand.function __fish_wt_global_optspecs- string join \n v/verbose h/help V/version+ string join \n v/verbose internal h/help V/versionendfunction __fish_wt_needs_commanddiff --git a/tests/snapshots/integration__integration_tests__init__init_zsh.snap b/tests/snapshots/integration__integration_tests__init__init_zsh.snapindex 5735d1fa7..f015effdb 100644--- a/tests/snapshots/integration__integration_tests__init__init_zsh.snap+++ b/tests/snapshots/integration__integration_tests__init__init_zsh.snap@@ -81,7 +81,7 @@ if command -v wt >/dev/null 2>&1; thenswitch|remove|merge)# Commands that need --internal for directory change supportshift- _wt_exec "$subcommand" --internal "$@"+ _wt_exec --internal "$subcommand" "$@";;*)# All other commands pass through directlydiff --git a/tests/snapshots/integration__integration_tests__list__detached_head.snap b/tests/snapshots/integration__integration_tests__list__detached_head.snapindex ce5b65f24..84ca33b34 100644--- a/tests/snapshots/integration__integration_tests__list__detached_head.snap+++ b/tests/snapshots/integration__integration_tests__list__detached_head.snap@@ -18,8 +18,8 @@ info:success: trueexit_code: 0----- stdout ------[2mBranch [0m [2mAge [0m [2mCommit [0m [2mMessage [0m [2mPath[0m-[1m[35m(detached)[0m [2m9 months ago[0m [1m[35mb834638e[0m [2mInitial commit[0m [1m[35m.[0m+[2mBranch [0m [2mAge [0m [2mCommit [0m [2mMessage [0m [2mPath[0m+[1m[35m(detached)[0m [2m10 months ago[0m [1m[35mb834638e[0m [2mInitial commit[0m [1m[35m.[0m[2mShowing 1 worktree[0mdiff --git a/tests/snapshots/integration__integration_tests__list__locked_no_reason.snap b/tests/snapshots/integration__integration_tests__list__locked_no_reason.snapindex 6c9d1454a..785012b4d 100644--- a/tests/snapshots/integration__integration_tests__list__locked_no_reason.snap+++ b/tests/snapshots/integration__integration_tests__list__locked_no_reason.snap@@ -18,9 +18,9 @@ info:success: trueexit_code: 0----- stdout ------[2mBranch [0m [2mAge [0m [2mCommit [0m [2mState [0m [2mPath[0m-[1m[35mmain [0m [2m9 months ago[0m [1m[35mb834638e[0m [1m[35m./test-repo[0m-locked-no-reason [2m9 months ago[0m [2mb834638e[0m (locked) ./locked-no-reason+[2mBranch [0m [2mAge [0m [2mCommit [0m [2mState [0m [2mPath[0m+[1m[35mmain [0m [2m10 months ago[0m [1m[35mb834638e[0m [1m[35m./test-repo[0m+locked-no-reason [2m10 months ago[0m [2mb834638e[0m (locked) ./locked-no-reason[2mShowing 2 worktrees[0mdiff --git a/tests/snapshots/integration__integration_tests__list__locked_worktree.snap b/tests/snapshots/integration__integration_tests__list__locked_worktree.snapindex 3c689f46b..b7f493746 100644--- a/tests/snapshots/integration__integration_tests__list__locked_worktree.snap+++ b/tests/snapshots/integration__integration_tests__list__locked_worktree.snap@@ -18,9 +18,9 @@ info:success: trueexit_code: 0----- stdout ------[2mBranch [0m [2mAge [0m [2mCommit [0m [2mMessage [0m [2mPath[0m-[1m[35mmain [0m [2m9 months ago[0m [1m[35mb834638e[0m [2mInitial commit[0m [1m[35m./test-repo[0m-locked-feature [2m9 months ago[0m [2mb834638e[0m [2mInitial commit[0m ./locked-feature+[2mBranch [0m [2mAge [0m [2mCommit [0m [2mMessage [0m [2mPath[0m+[1m[35mmain [0m [2m10 months ago[0m [1m[35mb834638e[0m [2mInitial commit[0m [1m[35m./test-repo[0m+locked-feature [2m10 months ago[0m [2mb834638e[0m [2mInitial commit[0m ./locked-feature[2mShowing 2 worktrees[0mdiff --git a/tests/snapshots/integration__integration_tests__list__long_commit_message.snap b/tests/snapshots/integration__integration_tests__list__long_commit_message.snapindex bb3ee2d78..317e2f249 100644--- a/tests/snapshots/integration__integration_tests__list__long_commit_message.snap+++ b/tests/snapshots/integration__integration_tests__list__long_commit_message.snap@@ -18,9 +18,9 @@ info:success: trueexit_code: 0----- stdout ------[2mBranch [0m [2mAge [0m [2mCommit [0m [2mMessage [0m [2mPath[0m-[1m[35mmain [0m [2m9 months ago[0m [1m[35m1310bfb9[0m [2mShort message[0m [1m[35m./test-repo[0m-feature-a [2m9 months ago[0m [2mf078644e[0m [2mThis is a very long commit...[0m ./feature-a+[2mBranch [0m [2mAge [0m [2mCommit [0m [2mMessage [0m [2mPath[0m+[1m[35mmain [0m [2m10 months ago[0m [1m[35m1310bfb9[0m [2mShort message[0m [1m[35m./test-repo[0m+feature-a [2m10 months ago[0m [2mf078644e[0m [2mThis is a very long commit...[0m ./feature-a[2mShowing 2 worktrees, 1 behind[0mdiff --git a/tests/snapshots/integration__integration_tests__list__many_worktrees_varied.snap b/tests/snapshots/integration__integration_tests__list__many_worktrees_varied.snapindex dda93cc06..0b2026b27 100644--- a/tests/snapshots/integration__integration_tests__list__many_worktrees_varied.snap+++ b/tests/snapshots/integration__integration_tests__list__many_worktrees_varied.snap@@ -18,12 +18,12 @@ info:success: trueexit_code: 0----- stdout ------[2mBranch [0m [2mAge [0m [2mCommit [0m [2mPath[0m-[1m[35mmain [0m [2m9 months ago[0m [1m[35mb834638e[0m [1m[35m./test-repo[0m-medium-name [2m9 months ago[0m [2mb834638e[0m ./medium-name-short [2m9 months ago[0m [2mb834638e[0m ./short-very-long-branch-name-here [2m9 months ago[0m [2mb834638e[0m ./very-long-branch-name-here-with-changes [2m9 months ago[0m [2mb834638e[0m ./with-changes+[2mBranch [0m [2mCommit [0m [2mPath[0m+[1m[35mmain [0m [1m[35mb834638e[0m [1m[35m./test-repo[0m+medium-name [2mb834638e[0m ./medium-name+short [2mb834638e[0m ./short+very-long-branch-name-here [2mb834638e[0m ./very-long-branch-name-here+with-changes [2mb834638e[0m ./with-changes[2mShowing 5 worktrees[0mdiff --git a/tests/snapshots/integration__integration_tests__list__multiple_worktrees.snap b/tests/snapshots/integration__integration_tests__list__multiple_worktrees.snapindex cfd3b104d..ea04989b2 100644--- a/tests/snapshots/integration__integration_tests__list__multiple_worktrees.snap+++ b/tests/snapshots/integration__integration_tests__list__multiple_worktrees.snap@@ -18,10 +18,10 @@ info:success: trueexit_code: 0----- stdout ------[2mBranch [0m [2mAge [0m [2mCommit [0m [2mMessage [0m [2mPath[0m-[1m[35mmain [0m [2m9 months ago[0m [1m[35mb834638e[0m [2mInitial commit[0m [1m[35m./test-repo[0m-feature-a [2m9 months ago[0m [2mb834638e[0m [2mInitial commit[0m ./feature-a-feature-b [2m9 months ago[0m [2mb834638e[0m [2mInitial commit[0m ./feature-b+[2mBranch [0m [2mAge [0m [2mCommit [0m [2mMessage [0m [2mPath[0m+[1m[35mmain [0m [2m10 months ago[0m [1m[35mb834638e[0m [2mInitial commit[0m [1m[35m./test-repo[0m+feature-a [2m10 months ago[0m [2mb834638e[0m [2mInitial commit[0m ./feature-a+feature-b [2m10 months ago[0m [2mb834638e[0m [2mInitial commit[0m ./feature-b[2mShowing 3 worktrees[0mdiff --git a/tests/snapshots/integration__integration_tests__list__single_worktree.snap b/tests/snapshots/integration__integration_tests__list__single_worktree.snapindex d88bda201..4e75a70be 100644--- a/tests/snapshots/integration__integration_tests__list__single_worktree.snap+++ b/tests/snapshots/integration__integration_tests__list__single_worktree.snap@@ -18,8 +18,8 @@ info:success: trueexit_code: 0----- stdout ------[2mBranch[0m [2mAge [0m [2mCommit [0m [2mMessage [0m [2mPath[0m-[1m[35mmain [0m [2m9 months ago[0m [1m[35mb834638e[0m [2mInitial commit[0m [1m[35m.[0m+[2mBranch[0m [2mAge [0m [2mCommit [0m [2mMessage [0m [2mPath[0m+[1m[35mmain [0m [2m10 months ago[0m [1m[35mb834638e[0m [2mInitial commit[0m [1m[35m.[0m[2mShowing 1 worktree[0mdiff --git a/tests/snapshots/integration__integration_tests__list__unicode_commit_message.snap b/tests/snapshots/integration__integration_tests__list__unicode_commit_message.snapindex 1c019a848..9389a896e 100644--- a/tests/snapshots/integration__integration_tests__list__unicode_commit_message.snap+++ b/tests/snapshots/integration__integration_tests__list__unicode_commit_message.snap@@ -18,9 +18,9 @@ info:success: trueexit_code: 0----- stdout ------[2mBranch [0m [2mAge [0m [2mCommit [0m [2mMessage [0m [2mPath[0m-[1m[35mmain [0m [2m9 months ago[0m [1m[35me4614cb7[0m [2mFix bug with cafΓ© β...[0m [1m[35m./test-repo[0m-feature-test [2m9 months ago[0m [2m0c53695b[0m [2mAdd support for...[0m ./feature-test+[2mBranch [0m [2mAge [0m [2mCommit [0m [2mMessage [0m [2mPath[0m+[1m[35mmain [0m [2m10 months ago[0m [1m[35me4614cb7[0m [2mFix bug with cafΓ©...[0m [1m[35m./test-repo[0m+feature-test [2m10 months ago[0m [2m0c53695b[0m [2mAdd support for...[0m ./feature-test[2mShowing 2 worktrees, 1 behind[0mdiff --git a/tests/snapshots/integration__integration_tests__list__with_branches_flag.snap b/tests/snapshots/integration__integration_tests__list__with_branches_flag.snapindex f314c31f2..f484eb072 100644--- a/tests/snapshots/integration__integration_tests__list__with_branches_flag.snap+++ b/tests/snapshots/integration__integration_tests__list__with_branches_flag.snap@@ -19,12 +19,12 @@ info:success: trueexit_code: 0----- stdout ------[2mBranch [0m [2mAge [0m [2mCommit [0m [2mPath[0m-[1m[35mmain [0m [2m9 months ago[0m [1m[35mb834638e[0m [1m[35m./test-repo[0m-feature-with-worktree [2m9 months ago[0m [2mb834638e[0m ./feature-with-worktree-another-branch [2m9 months ago[0m [2mb834638e[0m-feature-without-worktree [2m9 months ago[0m [2mb834638e[0m-fix-bug [2m9 months ago[0m [2mb834638e[0m+[2mBranch [0m [2mAge [0m [2mCommit [0m [2mPath[0m+[1m[35mmain [0m [2m10 months ago[0m [1m[35mb834638e[0m [1m[35m./test-repo[0m+feature-with-worktree [2m10 months ago[0m [2mb834638e[0m ./feature-with-worktree+another-branch [2m10 months ago[0m [2mb834638e[0m+feature-without-worktree [2m10 months ago[0m [2mb834638e[0m+fix-bug [2m10 months ago[0m [2mb834638e[0m[2mShowing 2 worktrees, 3 branches[0mdiff --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.snapindex 0af8cf4c0..55606ca12 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@@ -19,10 +19,10 @@ info:success: trueexit_code: 0----- stdout ------[2mBranch [0m [2mAge [0m [2mCommit [0m [2mMessage [0m [2mPath[0m-[1m[35mmain [0m [2m9 months ago[0m [1m[35mb834638e[0m [2mInitial commit[0m [1m[35m./test-repo[0m-feature-a [2m9 months ago[0m [2mb834638e[0m [2mInitial commit[0m ./feature-a-feature-b [2m9 months ago[0m [2mb834638e[0m [2mInitial commit[0m ./feature-b+[2mBranch [0m [2mAge [0m [2mCommit [0m [2mMessage [0m [2mPath[0m+[1m[35mmain [0m [2m10 months ago[0m [1m[35mb834638e[0m [2mInitial commit[0m [1m[35m./test-repo[0m+feature-a [2m10 months ago[0m [2mb834638e[0m [2mInitial commit[0m ./feature-a+feature-b [2m10 months ago[0m [2mb834638e[0m [2mInitial commit[0m ./feature-b[2mShowing 3 worktrees[0mdiff --git a/tests/snapshots/integration__integration_tests__list__with_branches_flag_only_branches.snap b/tests/snapshots/integration__integration_tests__list__with_branches_flag_only_branches.snapindex 062034523..564bb0691 100644--- a/tests/snapshots/integration__integration_tests__list__with_branches_flag_only_branches.snap+++ b/tests/snapshots/integration__integration_tests__list__with_branches_flag_only_branches.snap@@ -19,11 +19,11 @@ info:success: trueexit_code: 0----- stdout ------[2mBranch [0m [2mAge [0m [2mCommit [0m [2mMessage [0m [2mPath[0m-[1m[35mmain [0m [2m9 months ago[0m [1m[35mb834638e[0m [2mInitial commit[0m [1m[35m.[0m-branch-alpha [2m9 months ago[0m [2mb834638e[0m [2mInitial commit[0m-branch-beta [2m9 months ago[0m [2mb834638e[0m [2mInitial commit[0m-branch-gamma [2m9 months ago[0m [2mb834638e[0m [2mInitial commit[0m+[2mBranch [0m [2mAge [0m [2mCommit [0m [2mMessage [0m [2mPath[0m+[1m[35mmain [0m [2m10 months ago[0m [1m[35mb834638e[0m [2mInitial commit[0m [1m[35m.[0m+branch-alpha [2m10 months ago[0m [2mb834638e[0m [2mInitial commit[0m+branch-beta [2m10 months ago[0m [2mb834638e[0m [2mInitial commit[0m+branch-gamma [2m10 months ago[0m [2mb834638e[0m [2mInitial commit[0m[2mShowing 1 worktrees, 3 branches[0mdiff --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.snapindex c60162b57..03b049805 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@@ -19,11 +19,11 @@ info:success: trueexit_code: 0----- stdout ------[2mBranch [0m [2mAge [0m [2mWT +/-[0m [2mCommit [0m [2mMessage [0m [2mPath[0m-[1m[35mmain [0m [2m9 months ago[0m [1m[35mb834638e[0m [2mInitial commit[0m [1m[35m./test-repo[0m-also-no-changes [2m9 months ago[0m [2mb834638e[0m [2mInitial commit[0m ./also-no-changes-no-changes [2m9 months ago[0m [2mb834638e[0m [2mInitial commit[0m ./no-changes-with-changes [2m9 months ago[0m [32m+1[0m [31m-1[0m [2mb834638e[0m [2mInitial commit[0m ./with-changes+[2mBranch [0m [2mAge [0m [2mWT +/-[0m [2mCommit [0m [2mMessage [0m [2mPath[0m+[1m[35mmain [0m [2m10 months ago[0m [1m[35mb834638e[0m [2mInitial commit[0m [1m[35m./test-repo[0m+also-no-changes [2m10 months ago[0m [2mb834638e[0m [2mInitial commit[0m ./also-no-changes+no-changes [2m10 months ago[0m [2mb834638e[0m [2mInitial commit[0m ./no-changes+with-changes [2m10 months ago[0m [32m+1[0m [31m-1[0m [2mb834638e[0m [2mInitial commit[0m ./with-changes[2mShowing 4 worktrees, 1 with changes[0mdiff --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.snapindex 0f5afa4e3..cd93868b6 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@@ -19,10 +19,10 @@ info:success: trueexit_code: 0----- stdout ------[2mBranch[0m [2mAge [0m [2mWT +/-[0m [2mCommit [0m [2mMessage [0m [2mPath[0m-[1m[35mmain [0m [2m9 months ago[0m [1m[35mb834638e[0m [2mInitial commit[0m [1m[35m./test-repo[0m-huge [2m9 months ago[0m [2mb834638e[0m [2mInitial commit[0m ./huge-tiny [2m9 months ago[0m [32m+1[0m [31m-1[0m [2mb834638e[0m [2mInitial commit[0m ./tiny+[2mBranch[0m [2mAge [0m [2mWT +/-[0m [2mCommit [0m [2mMessage [0m [2mPath[0m+[1m[35mmain [0m [2m10 months ago[0m [1m[35mb834638e[0m [2mInitial commit[0m [1m[35m./test-repo[0m+huge [2m10 months ago[0m [2mb834638e[0m [2mInitial commit[0m ./huge+tiny [2m10 months ago[0m [32m+1[0m [31m-1[0m [2mb834638e[0m [2mInitial commit[0m ./tiny[2mShowing 3 worktrees, 1 with changes[0mdiff --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.snapindex 08d925d7d..2afb905be 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@@ -19,11 +19,11 @@ info:success: trueexit_code: 0----- stdout ------[2mBranch [0m [2mAge [0m [2mCommit [0m [2mMessage [0m [2mPath[0m-[1m[35mmain [0m [2m9 months ago[0m [1m[35mb834638e[0m [2mInitial commit[0m [1m[35m./test-repo[0m-feature-large [2m9 months ago[0m [2mb834638e[0m [2mInitial commit[0m ./feature-large-feature-medium [2m9 months ago[0m [2mb834638e[0m [2mInitial commit[0m ./feature-medium-feature-small [2m9 months ago[0m [2mb834638e[0m [2mInitial commit[0m ./feature-small+[2mBranch [0m [2mAge [0m [2mCommit [0m [2mMessage [0m [2mPath[0m+[1m[35mmain [0m [2m10 months ago[0m [1m[35mb834638e[0m [2mInitial commit[0m [1m[35m./test-repo[0m+feature-large [2m10 months ago[0m [2mb834638e[0m [2mInitial commit[0m ./feature-large+feature-medium [2m10 months ago[0m [2mb834638e[0m [2mInitial commit[0m ./feature-medium+feature-small [2m10 months ago[0m [2mb834638e[0m [2mInitial commit[0m ./feature-small[2mShowing 4 worktrees[0mdiff --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.snapindex 4c7ed988d..a9224e430 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@@ -18,11 +18,11 @@ info:success: trueexit_code: 0----- stdout ------[2mBranch[0m [2mAge [0m [2mCommit [0m [2mMessage [0m [2mPath[0m-[1m[35mmain [0m [2m9 months ago[0m [1m[35mb834638e[0m [2mInitial commit[0m [1m[35m./test-repo[0m-a [2m9 months ago[0m [2mb834638e[0m [2mInitial commit[0m ./a-bb [2m9 months ago[0m [2mb834638e[0m [2mInitial commit[0m ./bb-ccc [2m9 months ago[0m [2mb834638e[0m [2mInitial commit[0m ./ccc+[2mBranch[0m [2mAge [0m [2mCommit [0m [2mMessage [0m [2mPath[0m+[1m[35mmain [0m [2m10 months ago[0m [1m[35mb834638e[0m [2mInitial commit[0m [1m[35m./test-repo[0m+a [2m10 months ago[0m [2mb834638e[0m [2mInitial commit[0m ./a+bb [2m10 months ago[0m [2mb834638e[0m [2mInitial commit[0m ./bb+ccc [2m10 months ago[0m [2mb834638e[0m [2mInitial commit[0m ./ccc[2mShowing 4 worktrees[0mdiff --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.snapindex 481f3afd7..09a0a5b1e 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@@ -19,10 +19,10 @@ info:success: trueexit_code: 0----- stdout ------[2mBranch [0m [2mAge [0m [2mCommit [0m [2mMessage [0m [2mPath[0m-[1m[35mmain [0m [2m9 months ago[0m [1m[35ma7bc47ca[0m [2mInitial commit with a reasonably long message[0m [1m[35m./test-repo[0m-feature-a [2m9 months ago[0m [2ma7bc47ca[0m [2mInitial commit with a reasonably long message[0m ./feature-a-feature-b [2m9 months ago[0m [2ma7bc47ca[0m [2mInitial commit with a reasonably long message[0m ./feature-b+[2mBranch [0m [2mAge [0m [2mCommit [0m [2mMessage [0m [2mPath[0m+[1m[35mmain [0m [2m10 months ago[0m [1m[35ma7bc47ca[0m [2mInitial commit with a reasonably long message[0m [1m[35m./test-repo[0m+feature-a [2m10 months ago[0m [2ma7bc47ca[0m [2mInitial commit with a reasonably long message[0m ./feature-a+feature-b [2m10 months ago[0m [2ma7bc47ca[0m [2mInitial commit with a reasonably long message[0m ./feature-b[2mShowing 3 worktrees[0mdiff --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.snapindex 4cebf9fa9..84b5a52e6 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@@ -19,10 +19,10 @@ info:success: trueexit_code: 0----- stdout ------[2mBranch [0m [2mAge [0m [2mCommit [0m [2mMessage [0m [2mPath[0m-[1m[35mmain [0m [2m9 months ago[0m [1m[35ma7bc47ca[0m [2mInitial commit with a reasonably long message[0m [1m[35m./test-repo[0m-feature-a [2m9 months ago[0m [2ma7bc47ca[0m [2mInitial commit with a reasonably long message[0m ./feature-a-feature-b [2m9 months ago[0m [2ma7bc47ca[0m [2mInitial commit with a reasonably long message[0m ./feature-b+[2mBranch [0m [2mAge [0m [2mCommit [0m [2mMessage [0m [2mPath[0m+[1m[35mmain [0m [2m10 months ago[0m [1m[35ma7bc47ca[0m [2mInitial commit with a reasonably long message[0m [1m[35m./test-repo[0m+feature-a [2m10 months ago[0m [2ma7bc47ca[0m [2mInitial commit with a reasonably long message[0m ./feature-a+feature-b [2m10 months ago[0m [2ma7bc47ca[0m [2mInitial commit with a reasonably long message[0m ./feature-b[2mShowing 3 worktrees[0mdiff --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.snapindex 22802baae..92e6524e3 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@@ -19,10 +19,10 @@ info:success: trueexit_code: 0----- stdout ------[2mBranch [0m [2mAge [0m [2mCommit [0m [2mMessage [0m [2mPath[0m-[1m[35mmain [0m [2m9 months ago[0m [1m[35ma7bc47ca[0m [2mInitial commit with a...[0m [1m[35m./test-repo[0m-feature-a [2m9 months ago[0m [2ma7bc47ca[0m [2mInitial commit with a...[0m ./feature-a-feature-b [2m9 months ago[0m [2ma7bc47ca[0m [2mInitial commit with a...[0m ./feature-b+[2mBranch [0m [2mAge [0m [2mCommit [0m [2mMessage [0m [2mPath[0m+[1m[35mmain [0m [2m10 months ago[0m [1m[35ma7bc47ca[0m [2mInitial commit with a...[0m [1m[35m./test-repo[0m+feature-a [2m10 months ago[0m [2ma7bc47ca[0m [2mInitial commit with a...[0m ./feature-a+feature-b [2m10 months ago[0m [2ma7bc47ca[0m [2mInitial commit with a...[0m ./feature-b[2mShowing 3 worktrees[0mdiff --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.snapindex ff6d67660..d5f978b76 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@@ -18,11 +18,11 @@ info:success: trueexit_code: 0----- stdout ------[2mBranch[0m [2mAge [0m [2mCommit [0m [2mMessage [0m [2mPath[0m-[1m[35mmain [0m [2m9 months ago[0m [1m[35mb834638e[0m [2mInitial commit[0m [1m[35m./test-repo[0m-cafe [2m9 months ago[0m [2mb834638e[0m [2mInitial commit[0m ./cafΓ©-naive [2m9 months ago[0m [2mb834638e[0m [2mInitial commit[0m ./naΓ―ve-resume [2m9 months ago[0m [2mb834638e[0m [2mInitial commit[0m ./rΓ©sumΓ©+[2mBranch[0m [2mAge [0m [2mCommit [0m [2mMessage [0m [2mPath[0m+[1m[35mmain [0m [2m10 months ago[0m [1m[35mb834638e[0m [2mInitial commit[0m [1m[35m./test-repo[0m+cafe [2m10 months ago[0m [2mb834638e[0m [2mInitial commit[0m ./cafΓ©+naive [2m10 months ago[0m [2mb834638e[0m [2mInitial commit[0m ./naΓ―ve+resume [2m10 months ago[0m [2mb834638e[0m [2mInitial commit[0m ./rΓ©sumΓ©[2mShowing 4 worktrees[0m