Worktrunk is a CLI for Git worktree management, designed for parallel AI agent workflows
feat(list): demote branch-worktree mismatch from red flag to dim info (#3419)
Maximilian Roose02453aa5f2f
diff --git a/.claude/skills/writing-user-outputs/SKILL.md b/.claude/skills/writing-user-outputs/SKILL.mdindex aa5e83b3e..f468c43f2 100644--- a/.claude/skills/writing-user-outputs/SKILL.md+++ b/.claude/skills/writing-user-outputs/SKILL.md@@ -349,22 +349,25 @@ spawn_background(build_command_that_checks_merge_again()); // Duplicate check!## Warning Ordering-**Core principle:** Warnings about state discovered during evaluation appear-**before** the action message that follows from that evaluation.+**Core principle:** Messages about state discovered during evaluation+(warnings, info notices) appear **before** the action message that follows+from that evaluation.When a command evaluates state, discovers something unexpected, and proceeds-anyway, the warning should come first:+anyway, that message comes first:```-▲ Branch-worktree mismatch: feature @ ~/workspace/project.alias, expected @ ~/workspace/project.feature ⚑-◎ Removing feature worktree & branch in background (same commit as main, _)+▲ Auto-staging 1 untracked path:+ ┃ notes.md+◎ Generating commit message...```Not:```-◎ Removing feature worktree & branch in background (same commit as main, _)-▲ Branch-worktree mismatch: feature @ ~/workspace/project.alias, expected @ ~/workspace/project.feature ⚑+◎ Generating commit message...+▲ Auto-staging 1 untracked path:+ ┃ notes.md```Warnings that result from the action itself (something failed during execution)diff --git a/docs/content/list.md b/docs/content/list.mdindex 663d59768..277311799 100644--- a/docs/content/list.md+++ b/docs/content/list.md@@ -164,16 +164,16 @@ Independent flags from `git status`; several can show at once (e.g. `+!?`). Each### Worktree-An in-progress git operation, a worktree-location attribute, or a branch with no worktree. One symbol shows, highest priority first (`✘ > ⤴ > ⤵ > ⚑ > ⊟ > ⊞ > /`):+An in-progress git operation, a worktree-location attribute, or a branch with no worktree. One symbol shows, highest priority first (`✘ > ⤴ > ⤵ > ⊟ > ⊞ > ⚑ > /`):| Symbol | JSON | Meaning ||--------|------|---------|| `✘` | `operation_state` `"conflicts"` | Merge conflicts || `⤴` | `operation_state` `"rebase"` | Rebase in progress || `⤵` | `operation_state` `"merge"` | Merge in progress |-| `⚑` | `worktree.state` `"branch_worktree_mismatch"` | Branch name doesn't match the worktree path || `⊟` | `worktree.state` `"prunable"` | Prunable (worktree directory missing) || `⊞` | `worktree.state` `"locked"` | Locked worktree |+| `⚑` | `worktree.state` `"branch_worktree_mismatch"` | Branch name doesn't match the worktree path || `/` | `kind` `"branch"` | Branch without a worktree (no `worktree` object) |### Default branchdiff --git a/skills/worktrunk/reference/list.md b/skills/worktrunk/reference/list.mdindex b255e1a51..bb686c4eb 100644--- a/skills/worktrunk/reference/list.md+++ b/skills/worktrunk/reference/list.md@@ -149,16 +149,16 @@ Independent flags from `git status`; several can show at once (e.g. `+!?`). Each### Worktree-An in-progress git operation, a worktree-location attribute, or a branch with no worktree. One symbol shows, highest priority first (`✘ > ⤴ > ⤵ > ⚑ > ⊟ > ⊞ > /`):+An in-progress git operation, a worktree-location attribute, or a branch with no worktree. One symbol shows, highest priority first (`✘ > ⤴ > ⤵ > ⊟ > ⊞ > ⚑ > /`):| Symbol | JSON | Meaning ||--------|------|---------|| `✘` | `operation_state` `"conflicts"` | Merge conflicts || `⤴` | `operation_state` `"rebase"` | Rebase in progress || `⤵` | `operation_state` `"merge"` | Merge in progress |-| `⚑` | `worktree.state` `"branch_worktree_mismatch"` | Branch name doesn't match the worktree path || `⊟` | `worktree.state` `"prunable"` | Prunable (worktree directory missing) || `⊞` | `worktree.state` `"locked"` | Locked worktree |+| `⚑` | `worktree.state` `"branch_worktree_mismatch"` | Branch name doesn't match the worktree path || `/` | `kind` `"branch"` | Branch without a worktree (no `worktree` object) |### Default branchdiff --git a/src/cli/mod.rs b/src/cli/mod.rsindex bab0d881b..79bf41679 100644--- a/src/cli/mod.rs+++ b/src/cli/mod.rs@@ -905,16 +905,16 @@ Independent flags from `git status`; several can show at once (e.g. `+!?`). Each### Worktree-An in-progress git operation, a worktree-location attribute, or a branch with no worktree. One symbol shows, highest priority first (`✘ > ⤴ > ⤵ > ⚑ > ⊟ > ⊞ > /`):+An in-progress git operation, a worktree-location attribute, or a branch with no worktree. One symbol shows, highest priority first (`✘ > ⤴ > ⤵ > ⊟ > ⊞ > ⚑ > /`):| Symbol | JSON | Meaning ||--------|------|---------|| `✘` | `operation_state` `"conflicts"` | Merge conflicts || `⤴` | `operation_state` `"rebase"` | Rebase in progress || `⤵` | `operation_state` `"merge"` | Merge in progress |-| `⚑` | `worktree.state` `"branch_worktree_mismatch"` | Branch name doesn't match the worktree path || `⊟` | `worktree.state` `"prunable"` | Prunable (worktree directory missing) || `⊞` | `worktree.state` `"locked"` | Locked worktree |+| `⚑` | `worktree.state` `"branch_worktree_mismatch"` | Branch name doesn't match the worktree path || `/` | `kind` `"branch"` | Branch without a worktree (no `worktree` object) |### Default branchdiff --git a/src/commands/list/model/item.rs b/src/commands/list/model/item.rsindex 0a755b028..bfa165fad 100644--- a/src/commands/list/model/item.rs+++ b/src/commands/list/model/item.rs@@ -17,14 +17,15 @@ use crate::commands::list::columns::ColumnKind;////// Used by `refresh_status_symbols` to resolve the worktree-state position/// (Gate 2) from metadata alone. The decision priority is:-/// `branch_worktree_mismatch` > `prunable` > `locked` > `None`.+/// `prunable` > `locked` > `branch_worktree_mismatch` > `None` — the yellow+/// actionable states outrank the informational (dim yellow) mismatch flag.fn metadata_worktree_state(data: &WorktreeData) -> WorktreeState {- if data.branch_worktree_mismatch {- WorktreeState::BranchWorktreeMismatch- } else if data.is_prunable() {+ if data.is_prunable() {WorktreeState::Prunable} else if data.locked.is_some() {WorktreeState::Locked+ } else if data.branch_worktree_mismatch {+ WorktreeState::BranchWorktreeMismatch} else {WorktreeState::None}@@ -846,6 +847,32 @@ impl ListItem {mod tests {use super::*;+ /// The yellow actionable states outrank the informational (dim yellow)+ /// mismatch flag, so a demoted `⚑` can never mask `⊟` or `⊞`.+ #[test]+ fn test_metadata_worktree_state_priority() {+ let mismatched = WorktreeData {+ branch_worktree_mismatch: true,+ ..Default::default()+ };+ assert_eq!(+ metadata_worktree_state(&mismatched),+ WorktreeState::BranchWorktreeMismatch+ );++ let prunable = WorktreeData {+ prunable: Some("gone".to_string()),+ ..mismatched.clone()+ };+ assert_eq!(metadata_worktree_state(&prunable), WorktreeState::Prunable);++ let locked = WorktreeData {+ locked: Some("pinned".to_string()),+ ..mismatched.clone()+ };+ assert_eq!(metadata_worktree_state(&locked), WorktreeState::Locked);+ }+#[test]fn test_list_item_branch_name() {let item = ListItem::new_branch("abc123".to_string(), "feature".to_string());diff --git a/src/commands/list/model/state.rs b/src/commands/list/model/state.rsindex 5eaa8af1f..5fc482382 100644--- a/src/commands/list/model/state.rs+++ b/src/commands/list/model/state.rs@@ -74,7 +74,7 @@ impl Divergence {/// - For worktrees: whether the path matches the template, or has issues/// - For branches (without worktree): shows / to distinguish from worktrees///-/// Priority order for worktrees: BranchWorktreeMismatch > Prunable > Locked+/// Priority order for worktrees: Prunable > Locked > BranchWorktreeMismatch#[derive(Debug, Clone, Copy, PartialEq, Eq, Default, strum::IntoStaticStr)]pub enum WorktreeState {#[strum(serialize = "")]diff --git a/src/commands/list/model/status_symbols.rs b/src/commands/list/model/status_symbols.rsindex 36b5bdef8..60cd27cef 100644--- a/src/commands/list/model/status_symbols.rs+++ b/src/commands/list/model/status_symbols.rs@@ -22,7 +22,7 @@//! | 0 | `STAGED` | `+` | Are there staged changes? |//! | 1 | `MODIFIED` | `!` | Are there unstaged modifications? |//! | 2 | `UNTRACKED` | `?` | Are there untracked files? |-//! | 3 | `WORKTREE_STATE` | `✘ ⤴ ⤵ ⚑ ⊟ ⊞ /` | Operation / worktree attribute |+//! | 3 | `WORKTREE_STATE` | `✘ ⤴ ⤵ ⊟ ⊞ ⚑ /` | Operation / worktree attribute |//! | 4 | `MAIN_STATE` | `^ _ ⊂ ✗ – ↕ ↑ ↓` | Relationship to the default branch |//! | 5 | `UPSTREAM_DIVERGENCE` | \| ⇅ ⇡ ⇣ | Relationship to the tracked remote |//! | 6 | `USER_MARKER` | emoji / text | User-defined annotation |@@ -55,9 +55,9 @@//!//! # Gate 2: Worktree state (position 3)//!-//! **Renders:** at most one of `✘ ⤴ ⤵ ⚑ ⊟ ⊞ /`, priority-//! `✘ > ⤴ > ⤵ > ⚑ > ⊟ > ⊞ > /`. The operation family (`✘⤴⤵`) comes from live-//! task data; the attribute family (`⚑⊟⊞/`) is metadata, always known.+//! **Renders:** at most one of `✘ ⤴ ⤵ ⊟ ⊞ ⚑ /`, priority+//! `✘ > ⤴ > ⤵ > ⊟ > ⊞ > ⚑ > /`. The operation family (`✘⤴⤵`) comes from live+//! task data; the attribute family (`⊟⊞⚑/`) is metadata, always known.//!//! **Inputs:** `data.has_conflicts`, `data.git_operation`, plus metadata//! (`locked`, `prunable`, `branch_worktree_mismatch`, `ItemKind::Branch`).@@ -71,8 +71,8 @@//! 2. `has_conflicts == Some(false)` and `git_operation == Some(Rebase)` → `⤴`.//! 3. `has_conflicts == Some(false)` and `git_operation == Some(Merge)` → `⤵`.//! 4. `has_conflicts == Some(false)` and `git_operation == Some(None)` and-//! metadata says mismatched → `⚑`.-//! 5. …continuing down through `⊟`, `⊞`, `/`, nothing.+//! metadata says prunable → `⊟`.+//! 5. …continuing down through `⊞`, `⚑`, `/`, nothing.//!//! Until both `has_conflicts` and `git_operation` are known, we cannot rule//! out `✘/⤴/⤵`, so the position renders `·` even if metadata would otherwise@@ -274,7 +274,7 @@ impl PositionMask {1, // STAGED: + (1 char)1, // MODIFIED: ! (1 char)1, // UNTRACKED: ? (1 char)- 1, // WORKTREE_STATE: ✘⤴⤵/⚑⊟⊞ (1 char, priority: conflicts > rebase > merge > branch_worktree_mismatch > prunable > locked > branch)+ 1, // WORKTREE_STATE: ✘⤴⤵/⊟⊞⚑ (1 char, priority: conflicts > rebase > merge > prunable > locked > branch_worktree_mismatch > branch)1, // MAIN_STATE: ^_⊂✗–↕↑↓ (1 char, priority: is_main > orphan > empty > integrated > would_conflict > same_commit > diverged > ahead > behind)1, // UPSTREAM_DIVERGENCE: |⇡⇣⇅ (1 char)2, // USER_MARKER: single emoji or two chars (allocate 2)@@ -359,13 +359,13 @@ impl WorkingTreeStatus {/// ## Mutual Exclusivity////// **Worktree state (operations take priority over location):**-/// Priority: ✘ > ⤴ > ⤵ > ⚑ > ⊟ > ⊞ > /+/// Priority: ✘ > ⤴ > ⤵ > ⊟ > ⊞ > ⚑ > //// - ✘: Actual conflicts (must resolve)/// - ⤴: Rebase in progress/// - ⤵: Merge in progress-/// - ⚑: Branch-worktree mismatch/// - ⊟: Prunable (directory missing)/// - ⊞: Locked worktree+/// - ⚑: Branch-worktree mismatch (informational, dim yellow)/// - /: Branch without worktree////// **Main state (single position with priority):**@@ -564,7 +564,7 @@ impl StatusSymbols {SlotState::Visible(cformat!("<dim>{}</>", WorktreeState::Branch))}Some(WorktreeState::BranchWorktreeMismatch) => SlotState::Visible(cformat!(- "<red>{}</>",+ "<dim,yellow>{}</>",WorktreeState::BranchWorktreeMismatch)),Some(other) => SlotState::Visible(cformat!("<yellow>{}</>", other)),diff --git a/src/commands/picker/mod.rs b/src/commands/picker/mod.rsindex 92d6423f1..a6fd2ee0b 100644--- a/src/commands/picker/mod.rs+++ b/src/commands/picker/mod.rs@@ -337,7 +337,6 @@ impl AltXRemover {let caller_path = repo.current_worktree().root().ok();let result = {- let config = repo.user_config();let remove_target = match target {PickerRemovalTarget::WorktreePath(path) => RemoveTarget::Path(path),PickerRemovalTarget::Branch(branch) => RemoveTarget::Branch(branch),@@ -346,7 +345,6 @@ impl AltXRemover {remove_target,BranchDeletionMode::SafeDelete,false,- config,caller_path,None,None,@@ -2713,7 +2711,6 @@ pub mod tests {deletion_mode: BranchDeletionMode::SafeDelete,target_branch: Some("main".to_string()),force_worktree: false,- expected_path: None,removed_commit: None,};@@ -2808,7 +2805,6 @@ pub mod tests {deletion_mode: BranchDeletionMode::SafeDelete,target_branch: Some("main".to_string()),force_worktree: false,- expected_path: None,removed_commit: None,};@@ -2899,7 +2895,6 @@ pub mod tests {deletion_mode: BranchDeletionMode::SafeDelete,target_branch: Some("main".to_string()),force_worktree: false,- expected_path: None,removed_commit: None,};@@ -3581,7 +3576,6 @@ pub mod tests {deletion_mode: BranchDeletionMode::SafeDelete,target_branch: Some("main".to_string()),force_worktree: false,- expected_path: None,removed_commit: None,};assert_eq!(@@ -3597,7 +3591,6 @@ pub mod tests {deletion_mode: BranchDeletionMode::SafeDelete,target_branch: Some("main".to_string()),force_worktree: false,- expected_path: None,removed_commit: None,};assert_eq!(@@ -3945,7 +3938,6 @@ pub mod tests {deletion_mode: mode,target_branch: Some("main".to_string()),force_worktree: false,- expected_path: None,removed_commit: None,};@@ -4043,7 +4035,6 @@ pub mod tests {deletion_mode: BranchDeletionMode::SafeDelete,target_branch: Some("main".to_string()),force_worktree: false,- expected_path: None,removed_commit: None,};assert!(super::removal_target_still_present(@@ -4102,7 +4093,6 @@ pub mod tests {deletion_mode: BranchDeletionMode::SafeDelete,target_branch: Some("main".to_string()),force_worktree: false,- expected_path: None,removed_commit: None,};assert!(@@ -4148,7 +4138,6 @@ pub mod tests {deletion_mode: BranchDeletionMode::SafeDelete,target_branch: Some("main".to_string()),force_worktree: false,- expected_path: None,removed_commit: None,};assert!(diff --git a/src/commands/remove.rs b/src/commands/remove.rsindex b999f0545..3ee69bf0d 100644--- a/src/commands/remove.rs+++ b/src/commands/remove.rs@@ -56,7 +56,6 @@ impl RemovePlans {fn validate_remove_targets(repo: &Repository,branches: Vec<String>,- config: &UserConfig,keep_branch: bool,force_delete: bool,force: bool,@@ -112,7 +111,6 @@ fn validate_remove_targets(RemoveTarget::Current,deletion_mode,force,- config,None,worktrees,snapshot.as_ref(),@@ -134,7 +132,6 @@ fn validate_remove_targets(target,deletion_mode,force,- config,None,worktrees,snapshot.as_ref(),@@ -148,7 +145,6 @@ fn validate_remove_targets(RemoveTarget::Branch(&branch),deletion_mode,force,- config,None,worktrees,snapshot.as_ref(),@@ -338,7 +334,6 @@ pub fn handle_remove_command(args: RemoveArgs, yes: bool) -> anyhow::Result<()>RemoveTarget::Current,BranchDeletionMode::from_flags(!delete_branch, args.force_delete),args.force,- &config,None,None,None,@@ -384,7 +379,6 @@ pub fn handle_remove_command(args: RemoveArgs, yes: bool) -> anyhow::Result<()>let plans = validate_remove_targets(&repo,branches,- &config,!delete_branch,args.force_delete,args.force,diff --git a/src/commands/repository_ext.rs b/src/commands/repository_ext.rsindex 7b361f745..d41e7c449 100644--- a/src/commands/repository_ext.rs+++ b/src/commands/repository_ext.rs@@ -2,10 +2,9 @@ use std::path::{Path, PathBuf};use std::process;use std::time::{SystemTime, UNIX_EPOCH};-use super::worktree::{RemoveResult, path_mismatch};+use super::worktree::RemoveResult;use anyhow::{Context, bail};use color_print::cformat;-use worktrunk::config::UserConfig;use worktrunk::git::{BranchDeletionMode, GitError, IntegrationReason, RefSnapshot, Repository, WorktreeInfo,parse_porcelain_z, parse_untracked_files,@@ -53,7 +52,6 @@ pub trait RepositoryCliExt {target: RemoveTarget,deletion_mode: BranchDeletionMode,force_worktree: bool,- config: &UserConfig,current_path: Option<PathBuf>,worktrees: Option<&[WorktreeInfo]>,snapshot: Option<&RefSnapshot>,@@ -92,7 +90,6 @@ impl RepositoryCliExt for Repository {target: RemoveTarget,deletion_mode: BranchDeletionMode,force_worktree: bool,- config: &UserConfig,current_path: Option<PathBuf>,worktrees: Option<&[WorktreeInfo]>,snapshot: Option<&RefSnapshot>,@@ -293,12 +290,6 @@ impl RepositoryCliExt for Repository {_ => default_branch,};- // Compute expected_path for path mismatch detection- // Only set if actual path differs from expected (path mismatch)- let expected_path = branch_name- .as_ref()- .and_then(|branch| path_mismatch(self, branch, &worktree_path, config));-// Capture commit SHA before removal for post-remove hook template variables.// This ensures {{ commit }} references the removed worktree's state.let removed_commit = target_wt@@ -318,7 +309,6 @@ impl RepositoryCliExt for Repository {deletion_mode,target_branch,force_worktree,- expected_path,removed_commit,})}diff --git a/src/commands/step/prune.rs b/src/commands/step/prune.rsindex 602aecf4d..e7fb3ea70 100644--- a/src/commands/step/prune.rs+++ b/src/commands/step/prune.rs@@ -173,7 +173,6 @@ fn prune_summary(candidates: &[Candidate]) -> String {/// and passed by reference.struct RemovalContext<'a> {repo: &'a Repository,- config: &'a UserConfig,foreground: bool,hook_plan: &'a ApprovedHookPlan,worktrees: &'a [WorktreeInfo],@@ -207,7 +206,6 @@ fn try_remove(candidate: &Candidate, ctx: &RemovalContext<'_>) -> anyhow::Resulttarget,BranchDeletionMode::SafeDelete,false,- ctx.config,None,Some(ctx.worktrees),Some(ctx.snapshot),@@ -275,7 +273,6 @@ fn check_one(repo: &Repository,snapshot: &RefSnapshot,integration_target: &str,- config: &UserConfig,worktrees: &[WorktreeInfo],min_age_duration: Duration,now_secs: u64,@@ -303,7 +300,6 @@ fn check_one(target,BranchDeletionMode::SafeDelete,false,- config,None,Some(worktrees),Some(snapshot),@@ -725,7 +721,6 @@ pub fn step_prune(// main thread.let repo_ref = &repo;let snapshot_ref = &snapshot;- let config_ref = &config;let check_items_ref = &check_items;let integration_target_ref = integration_target.as_str();let check_lock_ref = &check_lock;@@ -741,7 +736,6 @@ pub fn step_prune(repo_ref,snapshot_ref,integration_target_ref,- config_ref,worktrees,min_age_duration,now_secs,@@ -875,7 +869,6 @@ pub fn step_prune(let check_lock = RwLock::new(());let removal_ctx = RemovalContext {repo: &repo,- config: &config,foreground,hook_plan: &hook_plan,worktrees,@@ -897,7 +890,6 @@ pub fn step_prune(// main thread's removal calls.let repo_ref = &repo;let snapshot_ref = &snapshot;- let config_ref = &config;let check_items_ref = &check_items;let integration_target_ref = integration_target.as_str();let check_lock_ref = &check_lock;@@ -913,7 +905,6 @@ pub fn step_prune(repo_ref,snapshot_ref,integration_target_ref,- config_ref,worktrees,min_age_duration,now_secs,diff --git a/src/commands/template_vars.rs b/src/commands/template_vars.rsindex 783eab789..99f9296f6 100644--- a/src/commands/template_vars.rs+++ b/src/commands/template_vars.rs@@ -260,7 +260,6 @@ mod tests {};let info = SwitchBranchInfo {branch: Some("contributor/feature".to_string()),- expected_path: None,};let vars = TemplateVars::for_post_switch(&result, &info, "", "");let pairs = vars.as_extra_vars();@@ -279,7 +278,6 @@ mod tests {};let info = SwitchBranchInfo {branch: Some("feature".to_string()),- expected_path: None,};let vars = TemplateVars::for_post_switch(&result, &info, "main", "/repo");let pairs = vars.as_extra_vars();@@ -295,7 +293,6 @@ mod tests {let result = SwitchResult::AlreadyAt(PathBuf::from("/repo.feature"));let info = SwitchBranchInfo {branch: Some("feature".to_string()),- expected_path: None,};let vars = TemplateVars::for_post_switch(&result, &info, "", "");let pairs = vars.as_extra_vars();@@ -309,10 +306,7 @@ mod tests {let result = SwitchResult::Existing {path: PathBuf::from("/repo.detached"),};- let info = SwitchBranchInfo {- branch: None,- expected_path: None,- };+ let info = SwitchBranchInfo { branch: None };let vars = TemplateVars::for_post_switch(&result, &info, "", "");let pairs = vars.as_extra_vars();assert!(!pairs.iter().any(|(k, _)| *k == "target"));diff --git a/src/commands/worktree/finish.rs b/src/commands/worktree/finish.rsindex 1ea09c218..7ead48b07 100644--- a/src/commands/worktree/finish.rs+++ b/src/commands/worktree/finish.rs@@ -27,7 +27,6 @@ use worktrunk::config::UserConfig;use worktrunk::git::{BranchDeletionMode, Repository};use worktrunk::styling::{eprintln, info_message};-use super::resolve::path_mismatch;use super::types::RemoveResult;use crate::commands::command_executor::CommandContext;use crate::commands::context::CommandEnv;@@ -129,7 +128,6 @@ pub fn finish_after_merge(current_wt.ensure_clean("remove worktree after merge", Some(current_branch), false)?;let worktree_root = current_wt.root()?;- let expected_path = path_mismatch(repo, current_branch, &worktree_root, config);// No config snapshot: `pre-remove` / `post-remove` were selected and// frozen into `plan` at the gate (anchored at `feature_path`), so the@@ -142,7 +140,6 @@ pub fn finish_after_merge(deletion_mode: BranchDeletionMode::SafeDelete,target_branch: Some(target_branch.to_string()),force_worktree: false,- expected_path,removed_commit: feature_commit.clone(),};handle_remove_output(diff --git a/src/commands/worktree/mod.rs b/src/commands/worktree/mod.rsindex bab1f7553..f98853f3b 100644--- a/src/commands/worktree/mod.rs+++ b/src/commands/worktree/mod.rs@@ -92,7 +92,7 @@ mod types;pub use finish::{FinishAfterMergeArgs, finish_after_merge};pub use push::{PushKind, PushOutcome, PushResult, handle_no_ff_merge, handle_push};pub use resolve::{- compute_worktree_path, is_worktree_at_expected_path, path_mismatch, resolve_worktree_arg,+ compute_worktree_path, is_worktree_at_expected_path, resolve_worktree_arg,worktree_display_name,};pub(crate) use switch::SwitchPipeline;diff --git a/src/commands/worktree/resolve.rs b/src/commands/worktree/resolve.rsindex d9b99f082..05ca3a4da 100644--- a/src/commands/worktree/resolve.rs+++ b/src/commands/worktree/resolve.rs@@ -133,21 +133,6 @@ pub fn is_worktree_at_expected_path(}}-/// Returns the expected path if `actual_path` differs from the template-computed path.-///-/// Returns `Some(expected_path)` when there's a mismatch, `None` when paths match.-/// Used to show path mismatch warnings in switch, picker, remove, and merge.-pub fn path_mismatch(- repo: &Repository,- branch: &str,- actual_path: &std::path::Path,- config: &UserConfig,-) -> Option<PathBuf> {- compute_worktree_path(repo, branch, config)- .ok()- .filter(|expected| !paths_match(actual_path, expected))-}-/// Compute a user-facing display name for a worktree.////// Returns styled content with branch names bolded:diff --git a/src/commands/worktree/switch.rs b/src/commands/worktree/switch.rsindex 6ad2ecff3..89c074a75 100644--- a/src/commands/worktree/switch.rs+++ b/src/commands/worktree/switch.rs@@ -30,7 +30,7 @@ use worktrunk::styling::{warning_message,};-use super::resolve::{compute_worktree_path, offer_bare_repo_worktree_path_fix, path_mismatch};+use super::resolve::{compute_worktree_path, offer_bare_repo_worktree_path_fix};use super::types::{CreationMethod, SwitchBranchInfo, SwitchPlan, SwitchResult};use crate::cli::{SwitchArgs, SwitchFormat};use crate::commands::backup::back_up_clobbered_path_now;@@ -901,9 +901,7 @@ fn plan_switch(/// Execute a validated switch plan.////// Takes a `SwitchPlan` from `plan_switch()` and executes it.-/// For `SwitchPlan::Existing`, just records history. The returned-/// `SwitchBranchInfo` has `expected_path: None` — callers fill it in after-/// first output to avoid computing path mismatch on the hot path.+/// For `SwitchPlan::Existing`, just records history./// For `SwitchPlan::Create`, creates the worktree and runs hooks.fn execute_switch(repo: &Repository,@@ -942,13 +940,7 @@ fn execute_switch(// Path mismatch is computed lazily by callers after first output,// avoiding ~7 git commands on the hot path for existing switches.- Ok((- result,- SwitchBranchInfo {- branch,- expected_path: None,- },- ))+ Ok((result, SwitchBranchInfo { branch }))}SwitchPlan::Create {@@ -1213,7 +1205,6 @@ fn execute_switch(},SwitchBranchInfo {branch: Some(branch),- expected_path: None,},))}@@ -1651,23 +1642,6 @@ impl SwitchPipeline<'_> {return Ok(());}- // Compute path mismatch lazily (deferred from plan_switch for existing- // worktrees). Skip detached HEAD worktrees (branch is None) — no branch- // to compute the expected path from.- let branch_info = match &result {- SwitchResult::Existing { path } | SwitchResult::AlreadyAt(path) => {- let expected_path = branch_info- .branch- .as_deref()- .and_then(|b| path_mismatch(repo, b, path, config));- SwitchBranchInfo {- expected_path,- ..branch_info- }- }- _ => branch_info,- };-// Show success message (temporal locality: immediately after the// worktree operation). Returns the path to display in hooks when the// user's shell won't be in the worktree, and shows the worktree-pathdiff --git a/src/commands/worktree/types.rs b/src/commands/worktree/types.rsindex 05021f2f6..20ea541ff 100644--- a/src/commands/worktree/types.rs+++ b/src/commands/worktree/types.rs@@ -56,8 +56,6 @@ impl SwitchResult {pub struct SwitchBranchInfo {/// The branch being switched to. `None` for detached HEAD worktrees.pub branch: Option<String>,- /// Expected path when there's a branch-worktree mismatch (None = path matches template)- pub expected_path: Option<PathBuf>,}/// How the worktree will be created.@@ -163,9 +161,6 @@ pub enum RemoveResult {target_branch: Option<String>,/// Force git worktree removal even with untracked files.force_worktree: bool,- /// Expected path based on config template. `Some` when actual path differs- /// from expected (path mismatch), `None` when path matches template.- expected_path: Option<PathBuf>,/// Commit SHA of the removed worktree's HEAD, captured before removal./// Used for post-remove hook template variables so they reference the/// removed worktree's state, not the execution context.@@ -279,7 +274,6 @@ mod tests {deletion_mode: BranchDeletionMode::default(),target_branch: None,force_worktree: false,- expected_path: None,removed_commit: None,};assert_eq!(removed.branch_name(), Some("feature"));@@ -341,7 +335,6 @@ mod tests {deletion_mode: BranchDeletionMode::SafeDelete,target_branch: Some("main".to_string()),force_worktree: false,- expected_path: None,removed_commit: Some("abc1234567890".to_string()),};match result {@@ -353,7 +346,6 @@ mod tests {deletion_mode,target_branch,force_worktree,- expected_path,removed_commit,} => {assert_eq!(main_path.to_str().unwrap(), "/main");@@ -364,7 +356,6 @@ mod tests {assert!(!deletion_mode.is_force());assert_eq!(target_branch.as_deref(), Some("main"));assert!(!force_worktree);- assert!(expected_path.is_none());assert_eq!(removed_commit.as_deref(), Some("abc1234567890"));}_ => panic!("Expected RemovedWorktree variant"),@@ -436,7 +427,6 @@ mod tests {deletion_mode: BranchDeletionMode::ForceDelete,target_branch: None,force_worktree: true,- expected_path: None,removed_commit: None, // Detached HEAD may not have meaningful commit};match result {diff --git a/src/md_help.rs b/src/md_help.rsindex a87fefeac..501909a14 100644--- a/src/md_help.rs+++ b/src/md_help.rs@@ -486,10 +486,10 @@ fn colorize_status_symbols(text: &str) -> String {result = replace_dim(result, "⤵", warning);result = replace_dim(result, "✗", warning);- // Worktree state: BranchWorktreeMismatch (red), Prunable/Locked (yellow)- result = replace_dim(result, "⚑", error);+ // Worktree state: Prunable/Locked (yellow), BranchWorktreeMismatch (dim yellow)result = replace_dim(result, "⊟", warning);result = replace_dim(result, "⊞", warning);+ result = replace_dim(result, "⚑", warning.dimmed());// CI legend samples: replace dimmed `#` followed by a color namelet dimmed_hash = format!("{dim}#{dim:#}");diff --git a/src/output/handlers.rs b/src/output/handlers.rsindex d0caecc7c..4a7a38d0f 100644--- a/src/output/handlers.rs+++ b/src/output/handlers.rs@@ -457,29 +457,12 @@ fn format_switch_message(}}-/// Format a branch-worktree mismatch warning message.-///-/// Shows when a worktree is at a path that doesn't match the config template.-/// Displays both the actual location and the expected location.-fn format_path_mismatch_warning(- branch: &str,- actual_path: &Path,- expected_path: &Path,-) -> FormattedMessage {- let actual_display = format_path_for_display(actual_path);- let expected_display = format_path_for_display(expected_path);- warning_message(cformat!(- "Branch-worktree mismatch: <bold>{branch}</> @ <bold>{actual_display}</>, expected @ <bold>{expected_display}</> <red>⚑</>"- ))-}-struct SwitchOutputContext {path: PathBuf,path_display: String,branch: String,shell_warning_reason: Option<String>,user_wont_be_in_worktree: bool,- branch_worktree_mismatch_warning: Option<FormattedMessage>,is_git_subcommand: bool,}@@ -505,10 +488,6 @@ fn build_switch_output_context(Some(compute_shell_warning_reason())};let user_wont_be_in_worktree = !change_dir || shell_warning_reason.is_some();- let branch_worktree_mismatch_warning = branch_info- .expected_path- .as_ref()- .map(|expected| format_path_mismatch_warning(&branch, &path, expected));SwitchOutputContext {path,@@ -516,17 +495,10 @@ fn build_switch_output_context(branch,shell_warning_reason,user_wont_be_in_worktree,- branch_worktree_mismatch_warning,is_git_subcommand,}}-fn print_switch_path_mismatch_warning(ctx: &SwitchOutputContext) {- if let Some(warning) = &ctx.branch_worktree_mismatch_warning {- eprintln!("{}", warning);- }-}-fn print_switch_directory_hint(branch: &str, is_git_subcommand: bool) {if is_git_subcommand {eprintln!("{}", hint_message(git_subcommand_warning()));@@ -536,7 +508,6 @@ fn print_switch_directory_hint(branch: &str, is_git_subcommand: bool) {}fn handle_switch_already_at_output(ctx: &SwitchOutputContext) -> Option<PathBuf> {- print_switch_path_mismatch_warning(ctx);eprintln!("{}",info_message(cformat!(@@ -549,8 +520,6 @@ fn handle_switch_already_at_output(ctx: &SwitchOutputContext) -> Option<PathBuf>}fn handle_switch_existing_output(ctx: &SwitchOutputContext) -> Option<PathBuf> {- print_switch_path_mismatch_warning(ctx);-if let Some(reason) = &ctx.shell_warning_reason {eprintln!("{}",@@ -1035,7 +1004,6 @@ pub fn handle_remove_output(deletion_mode,target_branch,force_worktree,- expected_path,removed_commit,} => handle_removed_worktree_output(RemovedWorktreeOutputContext {@@ -1046,7 +1014,6 @@ pub fn handle_remove_output(deletion_mode: *deletion_mode,target_branch: target_branch.as_deref(),force_worktree: *force_worktree,- expected_path: expected_path.as_deref(),removed_commit: removed_commit.as_deref(),plan,foreground,@@ -1493,7 +1460,6 @@ struct RemovedWorktreeOutputContext<'a> {deletion_mode: BranchDeletionMode,target_branch: Option<&'a str>,force_worktree: bool,- expected_path: Option<&'a Path>,removed_commit: Option<&'a str>,/// The frozen, approved hook plan. `pre-remove` / `post-remove` //// `post-switch` execute only from this — no `.config/wt.toml` re-read,@@ -1720,13 +1686,6 @@ fn handle_named_removed_worktree_foreground(progress_message(cformat!("Removing <bold>{branch_name}</> worktree...")));- if let Some(expected) = ctx.expected_path {- eprintln!(- "{}",- format_path_mismatch_warning(branch_name, ctx.worktree_path, expected)- );- }-let snapshot = repo.capture_refs()?;let output = remove_worktree_with_cleanup(repo,@@ -1775,13 +1734,6 @@ fn handle_named_removed_worktree_background(branch_name: &str,announcer: &mut HookAnnouncer<'_>,) -> anyhow::Result<()> {- if let Some(expected) = ctx.expected_path {- eprintln!(- "{}",- format_path_mismatch_warning(branch_name, ctx.worktree_path, expected)- );- }-let display_info = RemovalDisplayInfo::from_precomputed(ctx.deletion_mode,safety.integration_reason,diff --git a/tests/integration_tests/remove.rs b/tests/integration_tests/remove.rsindex 5e493acb3..cc0046fb2 100644--- a/tests/integration_tests/remove.rs+++ b/tests/integration_tests/remove.rs@@ -2432,9 +2432,10 @@ approved-commands = ["echo 'branch={{{{ branch }}}}' > {branch_path}"]////// When a worktree is created at a path that doesn't match the config template,-/// `wt remove` should show a warning about the path mismatch.+/// `wt remove` proceeds with no mismatch notice (the state is informational,+/// surfaced only by the `wt list` glyph).#[rstest]-fn test_remove_path_mismatch_warning(repo: TestRepo) {+fn test_remove_path_mismatch(repo: TestRepo) {// Create a worktree at a non-standard path using raw git// (wt switch --create would put it at the expected path)let unexpected_path = repo@@ -2454,12 +2455,12 @@ fn test_remove_path_mismatch_warning(repo: TestRepo) {.run().unwrap();- // Remove the worktree - should show path mismatch warning+ // Remove the worktree - no mismatch noticeassert_cmd_snapshot!(make_snapshot_cmd(&repo, "remove", &["feature"], None));}#[rstest]-fn test_remove_path_mismatch_warning_foreground(repo: TestRepo) {+fn test_remove_path_mismatch_foreground(repo: TestRepo) {// Create a worktree at a non-standard path using raw gitlet unexpected_path = repo.root_path()@@ -2478,7 +2479,7 @@ fn test_remove_path_mismatch_warning_foreground(repo: TestRepo) {.run().unwrap();- // Remove in foreground mode - should show path mismatch warning+ // Remove in foreground mode - no mismatch noticeassert_cmd_snapshot!(make_snapshot_cmd(&repo,"remove",diff --git a/tests/integration_tests/switch.rs b/tests/integration_tests/switch.rsindex f06d9af80..aad7deade 100644--- a/tests/integration_tests/switch.rs+++ b/tests/integration_tests/switch.rs@@ -1518,7 +1518,7 @@ fn test_switch_no_warning_when_branch_matches(mut repo: TestRepo) {}#[rstest]-fn test_switch_branch_worktree_mismatch_shows_hint(repo: TestRepo) {+fn test_switch_branch_worktree_mismatch(repo: TestRepo) {// Create a worktree at a non-standard path (sibling to repo, not following template)let wrong_path = repo.root_path().parent().unwrap().join("wrong-path");repo.run_git(&[@@ -1529,17 +1529,13 @@ fn test_switch_branch_worktree_mismatch_shows_hint(repo: TestRepo) {"feature",]);- // Switch to feature - should show hint about branch-worktree mismatch- snapshot_switch_with_directive_file(- "switch_branch_worktree_mismatch_shows_hint",- &repo,- &["feature"],- );+ // Switch to feature - no mismatch notice; the state shows only in wt list+ snapshot_switch_with_directive_file("switch_branch_worktree_mismatch", &repo, &["feature"]);}///-/// When shell integration is not active, the branch-worktree mismatch warning should appear-/// alongside the "cannot change directory" warning.+/// Without shell integration, switching to a mismatched worktree shows only+/// the "cannot change directory" warning — no mismatch notice.#[rstest]fn test_switch_worktree_mismatch_no_shell_integration(repo: TestRepo) {// Create a worktree at a non-standard path@@ -1556,7 +1552,7 @@ fn test_switch_worktree_mismatch_no_shell_integration(repo: TestRepo) {"feature-mismatch",]);- // Switch without directive file (no shell integration) - should show both warnings+ // Switch without directive file (no shell integration)snapshot_switch("switch_branch_worktree_mismatch_no_shell",&repo,@@ -1566,7 +1562,7 @@ fn test_switch_worktree_mismatch_no_shell_integration(repo: TestRepo) {////// When already in a worktree whose path doesn't match the branch name,-/// switching to that branch should show the branch-worktree mismatch warning.+/// switching to that branch acknowledges the location with no mismatch notice.#[rstest]fn test_switch_already_at_with_branch_worktree_mismatch(repo: TestRepo) {// Create a worktree at a non-standard path@@ -1583,7 +1579,7 @@ fn test_switch_already_at_with_branch_worktree_mismatch(repo: TestRepo) {"feature-already",]);- // Switch from within the worktree with branch-worktree mismatch (AlreadyAt case)+ // Switch from within the mismatched worktree (AlreadyAt case)snapshot_switch_from_dir("switch_already_at_branch_worktree_mismatch",&repo,diff --git a/tests/snapshots/integration__integration_tests__help__help_list_long.snap b/tests/snapshots/integration__integration_tests__help__help_list_long.snapindex 7057daa6e..07116383b 100644--- a/tests/snapshots/integration__integration_tests__help__help_list_long.snap+++ b/tests/snapshots/integration__integration_tests__help__help_list_long.snap@@ -218,16 +218,16 @@ Independent flags from [2mgit status[0m; several can show at once (e.g. [2m+![32mWorktree[0m-An in-progress git operation, a worktree-location attribute, or a branch with no worktree. One symbol shows, highest priority first ([2m✘ > ⤴ > ⤵ > ⚑ > ⊟ > ⊞ > /[0m):+An in-progress git operation, a worktree-location attribute, or a branch with no worktree. One symbol shows, highest priority first ([2m✘ > ⤴ > ⤵ > ⊟ > ⊞ > ⚑ > /[0m):Symbol JSON Meaning────── ───────────────────────────────────────── ──────────────────────────────────────────────[31m✘[0m [2moperation_state[0m [2m"conflicts"[0m Merge conflicts[33m⤴[0m [2moperation_state[0m [2m"rebase"[0m Rebase in progress[33m⤵[0m [2moperation_state[0m [2m"merge"[0m Merge in progress- [31m⚑[0m [2mworktree.state[0m [2m"branch_worktree_mismatch"[0m Branch name doesn't match the worktree path[33m⊟[0m [2mworktree.state[0m [2m"prunable"[0m Prunable (worktree directory missing)[33m⊞[0m [2mworktree.state[0m [2m"locked"[0m Locked worktree+ [2m[33m⚑[0m [2mworktree.state[0m [2m"branch_worktree_mismatch"[0m Branch name doesn't match the worktree path[2m/[0m [2mkind[0m [2m"branch"[0m Branch without a worktree (no [2mworktree[0m object)[32mDefault branch[0mdiff --git a/tests/snapshots/integration__integration_tests__help__help_list_narrow_80.snap b/tests/snapshots/integration__integration_tests__help__help_list_narrow_80.snapindex 6d5bfc38d..0e5b3fb51 100644--- a/tests/snapshots/integration__integration_tests__help__help_list_narrow_80.snap+++ b/tests/snapshots/integration__integration_tests__help__help_list_narrow_80.snap@@ -268,18 +268,18 @@ maps to a boolean in the [2mworking_tree[0m object:[32mWorktree[0mAn in-progress git operation, a worktree-location attribute, or a branch with no- worktree. One symbol shows, highest priority first ([2m✘ > ⤴ > ⤵ > ⚑ > ⊟ > ⊞ > /[0m):+ worktree. One symbol shows, highest priority first ([2m✘ > ⤴ > ⤵ > ⊟ > ⊞ > ⚑ > /[0m):Symbol JSON Meaning────── ───────────────────────────────────────── ─────────────────────────────[31m✘[0m [2moperation_state[0m [2m"conflicts"[0m Merge conflicts[33m⤴[0m [2moperation_state[0m [2m"rebase"[0m Rebase in progress[33m⤵[0m [2moperation_state[0m [2m"merge"[0m Merge in progress- [31m⚑[0m [2mworktree.state[0m [2m"branch_worktree_mismatch"[0m Branch name doesn't match the- worktree path[33m⊟[0m [2mworktree.state[0m [2m"prunable"[0m Prunable (worktree directorymissing)[33m⊞[0m [2mworktree.state[0m [2m"locked"[0m Locked worktree+ [2m[33m⚑[0m [2mworktree.state[0m [2m"branch_worktree_mismatch"[0m Branch name doesn't match the+ worktree path[2m/[0m [2mkind[0m [2m"branch"[0m Branch without a worktree (no[2mworktree[0m object)diff --git a/tests/snapshots/integration__integration_tests__list__list_branches_with_nonexistent_default_branch.snap b/tests/snapshots/integration__integration_tests__list__list_branches_with_nonexistent_default_branch.snapindex 41d717f42..e0b60a9ef 100644--- a/tests/snapshots/integration__integration_tests__list__list_branches_with_nonexistent_default_branch.snap+++ b/tests/snapshots/integration__integration_tests__list__list_branches_with_nonexistent_default_branch.snap@@ -46,7 +46,7 @@ success: trueexit_code: 0----- stdout -----[1mBranch[0m [1mStatus[0m [1mHEAD±[0m [1mmain↕[0m [1mmain…±[0m [1mRemote⇅[0m [1mPath[0m [1mCommit[0m [1mAge[0m [1mMessage[0m-@ main [31m⚑[39m[2m^[22m[2m|[22m [2m|[0m . [2m05a4a45d[0m [2m16h[0m [2mInitial commit[0m+@ main [33m[2m⚑[39m[22m[2m^[22m[2m|[22m [2m|[0m . [2m05a4a45d[0m [2m16h[0m [2mInitial commit[0m+ feature-a ../repo.feature-a [2m1b87d473[0m [2m16h[0m [2mAdd feature-a file[0m+ feature-b ../repo.feature-b [2mf62940fc[0m [2m16h[0m [2mAdd feature-b file[0m+ feature-c ../repo.feature-c [2m345c7c93[0m [2m16h[0m [2mAdd feature-c file[0mdiff --git a/tests/snapshots/integration__integration_tests__list__list_detached_head.snap b/tests/snapshots/integration__integration_tests__list__list_detached_head.snapindex 1072242e3..739242afd 100644--- a/tests/snapshots/integration__integration_tests__list__list_detached_head.snap+++ b/tests/snapshots/integration__integration_tests__list__list_detached_head.snap@@ -45,7 +45,7 @@ success: trueexit_code: 0----- stdout -----[1mBranch[0m [1mStatus[0m [1mHEAD±[0m [1mmain↕[0m [1mmain…±[0m [1mRemote⇅[0m [1mPath[0m [1mCommit[0m [1mAge[0m [1mMessage[0m-@ - [31m⚑[39m[2m^[22m . [2m05a4a45d[0m [2m16h[0m [2mInitial commit[0m+@ - [33m[2m⚑[39m[22m[2m^[22m . [2m05a4a45d[0m [2m16h[0m [2mInitial commit[0m+ feature-a [2m↑[22m [32m↑1[0m [32m+1[0m ../repo.feature-a [2m1b87d473[0m [2m16h[0m [2mAdd feature-a file[0m+ feature-b [2m↑[22m [32m↑1[0m [32m+1[0m ../repo.feature-b [2mf62940fc[0m [2m16h[0m [2mAdd feature-b file[0m+ feature-c [2m↑[22m [32m↑1[0m [32m+1[0m ../repo.feature-c [2m345c7c93[0m [2m16h[0m [2mAdd feature-c file[0mdiff --git a/tests/snapshots/integration__integration_tests__list__list_detached_head_in_worktree.snap b/tests/snapshots/integration__integration_tests__list__list_detached_head_in_worktree.snapindex 0af40afa6..7c59a8945 100644--- a/tests/snapshots/integration__integration_tests__list__list_detached_head_in_worktree.snap+++ b/tests/snapshots/integration__integration_tests__list__list_detached_head_in_worktree.snap@@ -46,7 +46,7 @@ exit_code: 0----- stdout -----[1mBranch[0m [1mStatus[0m [1mHEAD±[0m [1mmain↕[0m [1mmain…±[0m [1mRemote⇅[0m [1mPath[0m [1mCommit[0m [1mAge[0m [1mMessage[0m@ main [2m^[22m[2m|[22m [2m|[0m . [2m05a4a45d[0m [2m16h[0m [2mInitial commit[0m-+ [2m-[0m [31m⚑[39m[2m_[22m [2m../repo.feature[0m [2m05a4a45d[0m [2m16h[0m [2mInitial commit[0m++ [2m-[0m [33m[2m⚑[39m[22m[2m_[22m [2m../repo.feature[0m [2m05a4a45d[0m [2m16h[0m [2mInitial commit[0m+ feature-a [2m↑[22m [32m↑1[0m [32m+1[0m ../repo.feature-a [2m1b87d473[0m [2m16h[0m [2mAdd feature-a file[0m+ feature-b [2m↑[22m [32m↑1[0m [32m+1[0m ../repo.feature-b [2mf62940fc[0m [2m16h[0m [2mAdd feature-b file[0m+ feature-c [2m↑[22m [32m↑1[0m [32m+1[0m ../repo.feature-c [2m345c7c93[0m [2m16h[0m [2mAdd feature-c file[0mdiff --git a/tests/snapshots/integration__integration_tests__list__list_full_with_nonexistent_default_branch.snap b/tests/snapshots/integration__integration_tests__list__list_full_with_nonexistent_default_branch.snapindex 07afe1a58..c759c5e80 100644--- a/tests/snapshots/integration__integration_tests__list__list_full_with_nonexistent_default_branch.snap+++ b/tests/snapshots/integration__integration_tests__list__list_full_with_nonexistent_default_branch.snap@@ -46,7 +46,7 @@ success: trueexit_code: 0----- stdout -----[1mBranch[0m [1mStatus[0m [1mHEAD±[0m [1mmain↕[0m [1mmain…±[0m [1mRemote⇅[0m [1mCI[0m [1mPath[0m [1mCommit[0m [1mAge[0m [1mMessage[0m-@ main [31m⚑[39m[2m^[22m[2m|[22m [2m|[0m . [2m05a4a45d[0m [2m16h[0m [2mInitial commit[0m+@ main [33m[2m⚑[39m[22m[2m^[22m[2m|[22m [2m|[0m . [2m05a4a45d[0m [2m16h[0m [2mInitial commit[0m+ feature-a ../repo.feature-a [2m1b87d473[0m [2m16h[0m [2mAdd feature-a file[0m+ feature-b ../repo.feature-b [2mf62940fc[0m [2m16h[0m [2mAdd feature-b file[0m+ feature-c ../repo.feature-c [2m345c7c93[0m [2m16h[0m [2mAdd feature-c file[0mdiff --git a/tests/snapshots/integration__integration_tests__list__list_nested_worktree_current_indicator.snap b/tests/snapshots/integration__integration_tests__list__list_nested_worktree_current_indicator.snapindex 623b1f2a5..5a668f1d9 100644--- a/tests/snapshots/integration__integration_tests__list__list_nested_worktree_current_indicator.snap+++ b/tests/snapshots/integration__integration_tests__list__list_nested_worktree_current_indicator.snap@@ -45,7 +45,7 @@ success: trueexit_code: 0----- stdout -----[1mBranch[0m [1mStatus[0m [1mHEAD±[0m [1mmain↕[0m [1mmain…±[0m [1mRemote⇅[0m [1mPath[0m [1mCommit[0m [1mAge[0m [1mMessage[0m-@ [2mfeature[0m [31m⚑[39m[2m_[22m [2m./.worktrees/feature[0m [2m05a4a45d[0m [2m16h[0m [2mInitial commit[0m+@ [2mfeature[0m [33m[2m⚑[39m[22m[2m_[22m [2m./.worktrees/feature[0m [2m05a4a45d[0m [2m16h[0m [2mInitial commit[0m^ main [36m?[39m [2m^[22m[2m|[22m [2m|[0m . [2m05a4a45d[0m [2m16h[0m [2mInitial commit[0m+ feature-a [2m↑[22m [32m↑1[0m [32m+1[0m ../repo.feature-a [2m1b87d473[0m [2m16h[0m [2mAdd feature-a file[0m+ feature-b [2m↑[22m [32m↑1[0m [32m+1[0m ../repo.feature-b [2mf62940fc[0m [2m16h[0m [2mAdd feature-b file[0mdiff --git a/tests/snapshots/integration__integration_tests__list__list_primary_on_different_branch.snap b/tests/snapshots/integration__integration_tests__list__list_primary_on_different_branch.snapindex 887cd8be4..4a2666813 100644--- a/tests/snapshots/integration__integration_tests__list__list_primary_on_different_branch.snap+++ b/tests/snapshots/integration__integration_tests__list__list_primary_on_different_branch.snap@@ -45,7 +45,7 @@ success: trueexit_code: 0----- stdout -----[1mBranch[0m [1mStatus[0m [1mHEAD±[0m [1mmain↕[0m [1mmain…±[0m [1mRemote⇅[0m [1mPath[0m [1mCommit[0m [1mAge[0m [1mMessage[0m-@ develop [31m⚑[39m[2m^[22m . [2m05a4a45d[0m [2m16h[0m [2mInitial commit[0m+@ develop [33m[2m⚑[39m[22m[2m^[22m . [2m05a4a45d[0m [2m16h[0m [2mInitial commit[0m+ feature-a [2m↑[22m [32m↑1[0m [32m+1[0m ../repo.feature-a [2m1b87d473[0m [2m16h[0m [2mAdd feature-a file[0m+ feature-b [2m↑[22m [32m↑1[0m [32m+1[0m ../repo.feature-b [2mf62940fc[0m [2m16h[0m [2mAdd feature-b file[0m+ feature-c [2m↑[22m [32m↑1[0m [32m+1[0m ../repo.feature-c [2m345c7c93[0m [2m16h[0m [2mAdd feature-c file[0mdiff --git a/tests/snapshots/integration__integration_tests__list__list_task_dag_detached_head.snap b/tests/snapshots/integration__integration_tests__list__list_task_dag_detached_head.snapindex d481b26e0..0a5176189 100644--- a/tests/snapshots/integration__integration_tests__list__list_task_dag_detached_head.snap+++ b/tests/snapshots/integration__integration_tests__list__list_task_dag_detached_head.snap@@ -46,7 +46,7 @@ success: trueexit_code: 0----- stdout -----[1mBranch[0m [1mStatus[0m [1mHEAD±[0m [1mmain↕[0m [1mmain…±[0m [1mRemote⇅[0m [1mPath[0m [1mCommit[0m [1mAge[0m [1mMessage[0m-@ - [31m⚑[39m[2m^[22m . [2m05a4a45d[0m [2m16h[0m [2mInitial commit[0m+@ - [33m[2m⚑[39m[22m[2m^[22m . [2m05a4a45d[0m [2m16h[0m [2mInitial commit[0m+ feature-a [2m↑[22m [32m↑1[0m [32m+1[0m ../repo.feature-a [2m1b87d473[0m [2m16h[0m [2mAdd feature-a file[0m+ feature-b [2m↑[22m [32m↑1[0m [32m+1[0m ../repo.feature-b [2mf62940fc[0m [2m16h[0m [2mAdd feature-b file[0m+ feature-c [2m↑[22m [32m↑1[0m [32m+1[0m ../repo.feature-c [2m345c7c93[0m [2m16h[0m [2mAdd feature-c file[0mdiff --git a/tests/snapshots/integration__integration_tests__list__list_warns_when_default_branch_missing_worktree.snap b/tests/snapshots/integration__integration_tests__list__list_warns_when_default_branch_missing_worktree.snapindex 887cd8be4..4a2666813 100644--- a/tests/snapshots/integration__integration_tests__list__list_warns_when_default_branch_missing_worktree.snap+++ b/tests/snapshots/integration__integration_tests__list__list_warns_when_default_branch_missing_worktree.snap@@ -45,7 +45,7 @@ success: trueexit_code: 0----- stdout -----[1mBranch[0m [1mStatus[0m [1mHEAD±[0m [1mmain↕[0m [1mmain…±[0m [1mRemote⇅[0m [1mPath[0m [1mCommit[0m [1mAge[0m [1mMessage[0m-@ develop [31m⚑[39m[2m^[22m . [2m05a4a45d[0m [2m16h[0m [2mInitial commit[0m+@ develop [33m[2m⚑[39m[22m[2m^[22m . [2m05a4a45d[0m [2m16h[0m [2mInitial commit[0m+ feature-a [2m↑[22m [32m↑1[0m [32m+1[0m ../repo.feature-a [2m1b87d473[0m [2m16h[0m [2mAdd feature-a file[0m+ feature-b [2m↑[22m [32m↑1[0m [32m+1[0m ../repo.feature-b [2mf62940fc[0m [2m16h[0m [2mAdd feature-b file[0m+ feature-c [2m↑[22m [32m↑1[0m [32m+1[0m ../repo.feature-c [2m345c7c93[0m [2m16h[0m [2mAdd feature-c file[0mdiff --git a/tests/snapshots/integration__integration_tests__list__list_with_nonexistent_default_branch.snap b/tests/snapshots/integration__integration_tests__list__list_with_nonexistent_default_branch.snapindex 9f3bbf6dc..7e86f0765 100644--- a/tests/snapshots/integration__integration_tests__list__list_with_nonexistent_default_branch.snap+++ b/tests/snapshots/integration__integration_tests__list__list_with_nonexistent_default_branch.snap@@ -45,7 +45,7 @@ success: trueexit_code: 0----- stdout -----[1mBranch[0m [1mStatus[0m [1mHEAD±[0m [1mmain↕[0m [1mmain…±[0m [1mRemote⇅[0m [1mPath[0m [1mCommit[0m [1mAge[0m [1mMessage[0m-@ main [31m⚑[39m[2m^[22m[2m|[22m [2m|[0m . [2m05a4a45d[0m [2m16h[0m [2mInitial commit[0m+@ main [33m[2m⚑[39m[22m[2m^[22m[2m|[22m [2m|[0m . [2m05a4a45d[0m [2m16h[0m [2mInitial commit[0m+ feature-a ../repo.feature-a [2m1b87d473[0m [2m16h[0m [2mAdd feature-a file[0m+ feature-b ../repo.feature-b [2mf62940fc[0m [2m16h[0m [2mAdd feature-b file[0m+ feature-c ../repo.feature-c [2m345c7c93[0m [2m16h[0m [2mAdd feature-c file[0mdiff --git a/tests/snapshots/integration__integration_tests__remove__remove_path_mismatch_warning.snap b/tests/snapshots/integration__integration_tests__remove__remove_path_mismatch.snapsimilarity index 90%rename from tests/snapshots/integration__integration_tests__remove__remove_path_mismatch_warning.snaprename to tests/snapshots/integration__integration_tests__remove__remove_path_mismatch.snapindex c56b30aae..6ab4c45d8 100644--- a/tests/snapshots/integration__integration_tests__remove__remove_path_mismatch_warning.snap+++ b/tests/snapshots/integration__integration_tests__remove__remove_path_mismatch.snap@@ -7,6 +7,7 @@ info:- featureenv:APPDATA: "[TEST_CONFIG_HOME]"+ CLAUDE_CONFIG_DIR: "[TEST_CLAUDE_CONFIG]"CLICOLOR_FORCE: "1"COLUMNS: "500"GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"@@ -46,5 +47,4 @@ exit_code: 0----- stdout ---------- stderr ------[33m▲[39m [33mBranch-worktree mismatch: [1mfeature[22m @ [1m_PARENT_/weird-path-for-feature[22m, expected @ [1m_REPO_.feature[22m [31m⚑[39m[39m[36m◎[39m [36mRemoving [1mfeature[22m worktree & branch in background (same commit as [1mmain[22m,[39m [2m_[22m[36m)[39mdiff --git a/tests/snapshots/integration__integration_tests__remove__remove_path_mismatch_warning_foreground.snap b/tests/snapshots/integration__integration_tests__remove__remove_path_mismatch_foreground.snapsimilarity index 91%rename from tests/snapshots/integration__integration_tests__remove__remove_path_mismatch_warning_foreground.snaprename to tests/snapshots/integration__integration_tests__remove__remove_path_mismatch_foreground.snapindex a2da689ba..80060fbb3 100644--- a/tests/snapshots/integration__integration_tests__remove__remove_path_mismatch_warning_foreground.snap+++ b/tests/snapshots/integration__integration_tests__remove__remove_path_mismatch_foreground.snap@@ -8,6 +8,7 @@ info:- feature-fgenv:APPDATA: "[TEST_CONFIG_HOME]"+ CLAUDE_CONFIG_DIR: "[TEST_CLAUDE_CONFIG]"CLICOLOR_FORCE: "1"COLUMNS: "500"GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"@@ -48,5 +49,4 @@ exit_code: 0----- stderr -----[36m◎[39m [36mRemoving [1mfeature-fg[22m worktree...[39m-[33m▲[39m [33mBranch-worktree mismatch: [1mfeature-fg[22m @ [1m_PARENT_/another-weird-path[22m, expected @ [1m_REPO_.feature-fg[22m [31m⚑[39m[39m[32m✓[39m [32mRemoved [1mfeature-fg[22m worktree & branch (same commit as [1mmain[22m,[39m [2m_[22m[32m)[39m [90m(3 files · [BYTES] B[39m[90m)[39mdiff --git a/tests/snapshots/integration__integration_tests__step_promote__promote_shows_mismatch_in_list.snap b/tests/snapshots/integration__integration_tests__step_promote__promote_shows_mismatch_in_list.snapindex f38a73c77..22d698553 100644--- a/tests/snapshots/integration__integration_tests__step_promote__promote_shows_mismatch_in_list.snap+++ b/tests/snapshots/integration__integration_tests__step_promote__promote_shows_mismatch_in_list.snap@@ -45,8 +45,8 @@ success: trueexit_code: 0----- stdout -----[1mBranch[0m [1mStatus[0m [1mHEAD±[0m [1mmain↕[0m [1mmain…±[0m [1mRemote⇅[0m [1mPath[0m [1mCommit[0m [1mAge[0m [1mMessage[0m-@ feature [31m⚑[39m[2m^[22m . [2m05a4a45d[0m [2m16h[0m [2mInitial commit[0m-+ [2mmain[0m [31m⚑[39m[2m_[22m[2m|[22m [2m|[0m [2m../repo.feature[0m [2m05a4a45d[0m [2m16h[0m [2mInitial commit[0m+@ feature [33m[2m⚑[39m[22m[2m^[22m . [2m05a4a45d[0m [2m16h[0m [2mInitial commit[0m++ [2mmain[0m [33m[2m⚑[39m[22m[2m_[22m[2m|[22m [2m|[0m [2m../repo.feature[0m [2m05a4a45d[0m [2m16h[0m [2mInitial commit[0m+ feature-a [2m↑[22m [32m↑1[0m [32m+1[0m ../repo.feature-a [2m1b87d473[0m [2m16h[0m [2mAdd feature-a file[0m+ feature-b [2m↑[22m [32m↑1[0m [32m+1[0m ../repo.feature-b [2mf62940fc[0m [2m16h[0m [2mAdd feature-b file[0m+ feature-c [2m↑[22m [32m↑1[0m [32m+1[0m ../repo.feature-c [2m345c7c93[0m [2m16h[0m [2mAdd feature-c file[0mdiff --git a/tests/snapshots/integration__integration_tests__switch__switch_already_at_branch_worktree_mismatch.snap b/tests/snapshots/integration__integration_tests__switch__switch_already_at_branch_worktree_mismatch.snapindex f5bd1ee93..b0ed7c330 100644--- a/tests/snapshots/integration__integration_tests__switch__switch_already_at_branch_worktree_mismatch.snap+++ b/tests/snapshots/integration__integration_tests__switch__switch_already_at_branch_worktree_mismatch.snap@@ -7,6 +7,7 @@ info:- feature-alreadyenv:APPDATA: "[TEST_CONFIG_HOME]"+ CLAUDE_CONFIG_DIR: "[TEST_CLAUDE_CONFIG]"CLICOLOR_FORCE: "1"COLUMNS: "500"GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"@@ -46,6 +47,5 @@ exit_code: 0----- stdout ---------- stderr ------[33m▲[39m [33mBranch-worktree mismatch: [1mfeature-already[22m @ [1m_PARENT_/wrong-path-already[22m, expected @ [1m_REPO_.feature-already[22m [31m⚑[39m[39m[2m○[22m Already on worktree for [1mfeature-already[22m @ [1m_PARENT_/wrong-path-already[22m[2m↳[22m [2mTo enable automatic cd, run [4mwt config shell install[24m[22mdiff --git a/tests/snapshots/integration__integration_tests__switch__switch_branch_worktree_mismatch_shows_hint.snap b/tests/snapshots/integration__integration_tests__switch__switch_branch_worktree_mismatch.snapsimilarity index 91%rename from tests/snapshots/integration__integration_tests__switch__switch_branch_worktree_mismatch_shows_hint.snaprename to tests/snapshots/integration__integration_tests__switch__switch_branch_worktree_mismatch.snapindex abd8ccce9..9694f5c7f 100644--- a/tests/snapshots/integration__integration_tests__switch__switch_branch_worktree_mismatch_shows_hint.snap+++ b/tests/snapshots/integration__integration_tests__switch__switch_branch_worktree_mismatch.snap@@ -7,6 +7,7 @@ info:- featureenv:APPDATA: "[TEST_CONFIG_HOME]"+ CLAUDE_CONFIG_DIR: "[TEST_CLAUDE_CONFIG]"CLICOLOR_FORCE: "1"COLUMNS: "500"GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"@@ -48,6 +49,5 @@ exit_code: 0----- stdout ---------- stderr ------[33m▲[39m [33mBranch-worktree mismatch: [1mfeature[22m @ [1m_PARENT_/wrong-path[22m, expected @ [1m_REPO_.feature[22m [31m⚑[39m[39m[2m○[22m Switched to worktree for [1mfeature[22m @ [1m_PARENT_/wrong-path[22m[0mdiff --git a/tests/snapshots/integration__integration_tests__switch__switch_branch_worktree_mismatch_no_shell.snap b/tests/snapshots/integration__integration_tests__switch__switch_branch_worktree_mismatch_no_shell.snapindex 6a541cd10..65ebe6474 100644--- a/tests/snapshots/integration__integration_tests__switch__switch_branch_worktree_mismatch_no_shell.snap+++ b/tests/snapshots/integration__integration_tests__switch__switch_branch_worktree_mismatch_no_shell.snap@@ -7,6 +7,7 @@ info:- feature-mismatchenv:APPDATA: "[TEST_CONFIG_HOME]"+ CLAUDE_CONFIG_DIR: "[TEST_CLAUDE_CONFIG]"CLICOLOR_FORCE: "1"COLUMNS: "500"GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"@@ -46,6 +47,5 @@ exit_code: 0----- stdout ---------- stderr ------[33m▲[39m [33mBranch-worktree mismatch: [1mfeature-mismatch[22m @ [1m_PARENT_/wrong-path-no-shell[22m, expected @ [1m_REPO_.feature-mismatch[22m [31m⚑[39m[39m[33m▲[39m [33mWorktree for [1mfeature-mismatch[22m @ [1m_PARENT_/wrong-path-no-shell[22m, but cannot change directory — shell integration not installed[39m[2m↳[22m [2mTo enable automatic cd, run [4mwt config shell install[24m[22mdiff --git a/tests/snapshots/integration__integration_tests__user_hooks__combined_post_remove_and_post_switch_verbose.snap b/tests/snapshots/integration__integration_tests__user_hooks__combined_post_remove_and_post_switch_verbose.snapindex 3436531d2..cb272a0f5 100644--- a/tests/snapshots/integration__integration_tests__user_hooks__combined_post_remove_and_post_switch_verbose.snap+++ b/tests/snapshots/integration__integration_tests__user_hooks__combined_post_remove_and_post_switch_verbose.snap@@ -9,6 +9,7 @@ info:- "--force-delete"env:APPDATA: "[TEST_CONFIG_HOME]"+ CLAUDE_CONFIG_DIR: "[TEST_CLAUDE_CONFIG]"CLICOLOR_FORCE: "1"COLUMNS: "500"GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"@@ -48,10 +49,6 @@ exit_code: 0----- stdout ---------- stderr ------[2m○[22m [1mworktree-path[22m source-[107m [0m [2m[0m[2m[32m{{[0m[2m[0m[2m repo_path [0m[2m[32m}}[0m[2m/../[0m[2m[32m{{[0m[2m repo [0m[2m[32m}}[0m[2m.[0m[2m[32m{{[0m[2m branch [0m[2m[36m|[0m[2m [0m[2m[34msanitize[0m[2m [0m[2m[32m}}[0m-[2m○[22m [1mworktree-path[22m result-[107m [0m [2m[0m[2m[34m_REPO_/../repo.feature[0m[36m◎[39m [36mRemoving [1mfeature[22m worktree & branch in background (--force-delete)[39m[33m▲[39m [33mCannot change directory — shell integration not installed[39m[2m↳[22m [2mTo enable automatic cd, run [4mwt config shell install[24m[22mdiff --git a/tests/snapshots/integration__integration_tests__user_hooks__hook_verbose_variable_table.snap b/tests/snapshots/integration__integration_tests__user_hooks__hook_verbose_variable_table.snapindex 9473c62ca..a92b95513 100644--- a/tests/snapshots/integration__integration_tests__user_hooks__hook_verbose_variable_table.snap+++ b/tests/snapshots/integration__integration_tests__user_hooks__hook_verbose_variable_table.snap@@ -8,6 +8,7 @@ info:- featureenv:APPDATA: "[TEST_CONFIG_HOME]"+ CLAUDE_CONFIG_DIR: "[TEST_CLAUDE_CONFIG]"CLICOLOR_FORCE: "1"COLUMNS: "500"GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"@@ -76,9 +77,5 @@ exit_code: 0[107m [0m hook_name = noop[36m◎[39m [36mRunning pre-switch [1muser:noop[22m[39m[107m [0m [2m[0m[2m[34mtrue[0m-[0m[2m○[22m [1mworktree-path[22m source-[107m [0m [2m[0m[2m[32m{{[0m[2m[0m[2m repo_path [0m[2m[32m}}[0m[2m/../[0m[2m[32m{{[0m[2m repo [0m[2m[32m}}[0m[2m.[0m[2m[32m{{[0m[2m branch [0m[2m[36m|[0m[2m [0m[2m[34msanitize[0m[2m [0m[2m[32m}}[0m-[2m○[22m [1mworktree-path[22m result-[107m [0m [2m[0m[2m[34m_REPO_/../repo.feature[0m-[33m▲[39m [33mWorktree for [1mfeature[22m @ [1m_REPO_.feature[22m, but cannot change directory — shell integration not installed[39m+[0m[33m▲[39m [33mWorktree for [1mfeature[22m @ [1m_REPO_.feature[22m, but cannot change directory — shell integration not installed[39m[2m↳[22m [2mTo enable automatic cd, run [4mwt config shell install[24m[22m