Skip to content

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

fix: allow removing detached HEAD worktrees from picker (#1665)

worktrunk-bot47e6090502c0
diff --git a/CHANGELOG.md b/CHANGELOG.md
index e13660b65..1f4694e43 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,14 +1,40 @@
# Changelog
-## Unreleased
+## 0.31.0
-### Breaking
+### Improved
-- **Hook template variable `worktree_path` changed meaning** in two hook types: in **pre-switch** (existing worktrees), `{{ worktree_path }}` now points to the destination worktree instead of the source; in **post-merge**, it now points to the feature worktree (active) instead of the merge target. Use `{{ base_worktree_path }}` or `{{ cwd }}` for the previous behavior. ([#1655](https://github.com/max-sixty/worktrunk/pull/1655), [#1660](https://github.com/max-sixty/worktrunk/pull/1660))
+- **Hook template variables consolidated**: Bare variables (`branch`, `worktree_path`, `commit`) now consistently point to the Active worktree — the destination for switch/create, the source for merge/remove. New directional variables (`{{ base }}`, `{{ base_worktree_path }}`, `{{ target_worktree_path }}`, `{{ cwd }}`) give hooks explicit access to both sides of two-worktree operations. (Breaking: `{{ worktree_path }}` changed in pre-switch for existing worktrees and in post-merge — use `{{ cwd }}` or `{{ base_worktree_path }}` for the previous behavior.) [Docs](https://worktrunk.dev/hook/) ([#1655](https://github.com/max-sixty/worktrunk/pull/1655), [#1660](https://github.com/max-sixty/worktrunk/pull/1660), [#1663](https://github.com/max-sixty/worktrunk/pull/1663))
-### Improved
+- **Bare repo worktree-path prompt**: When a bare repo lives at a hidden path like `.git` or `.bare`, `wt switch` now detects that worktrees would get awkward names (e.g., `project/.git.feature`) and offers to configure a `worktree-path` override. Non-interactive environments show the config to add manually. ([#1656](https://github.com/max-sixty/worktrunk/pull/1656), thanks @seakayone for reporting [#1279](https://github.com/max-sixty/worktrunk/issues/1279))
+
+- **Shell completion for step aliases**: Tab-completing `wt step <TAB>` now shows configured aliases alongside built-in step commands, with `--dry-run`, `--yes`, and `--var` flags. ([#1641](https://github.com/max-sixty/worktrunk/pull/1641))
+
+- **`wt list` reclaims space from redundant columns**: When the Path column carries no useful information (all worktree paths are predictable from branch names), its space is reclaimed for Summary and Message. ([#1634](https://github.com/max-sixty/worktrunk/pull/1634))
+
+- **Syntax highlighting for alias dry-run**: `wt step <alias> --dry-run` now uses bash syntax highlighting, matching hook dry-run output. ([#1635](https://github.com/max-sixty/worktrunk/pull/1635))
+
+### Fixed
+
+- **`wt list` hang from fsmonitor daemon**: On macOS with builtin fsmonitor, `wt list` could hang at the "(loading...)" stage because `git fsmonitor--daemon start` inherited pipe file descriptors and held them open indefinitely. ([#1648](https://github.com/max-sixty/worktrunk/pull/1648))
+
+- **Post-remove hooks ran at wrong directory**: Post-remove hooks executed at the user's cwd (which could be the worktree being removed) instead of the primary worktree. ([#1645](https://github.com/max-sixty/worktrunk/pull/1645))
+
+- **Picker showed loading indicator for unavailable data**: The interactive picker used `⋯` (loading) for fields that would never arrive; now uses `·` (unavailable). ([#1651](https://github.com/max-sixty/worktrunk/pull/1651))
+
+- **`wt hook --dry-run` missing directional variables**: Hook dry-run and `--show --expanded` output was missing `base`, `target`, and `target_worktree_path` variables for switch, create, and remove hooks. ([#1669](https://github.com/max-sixty/worktrunk/pull/1669))
+
+### Documentation
+
+- Bare repository layout guide and `worktree-path` example in config docs. ([#1664](https://github.com/max-sixty/worktrunk/pull/1664))
+
+- Migration guide for template variable changes in hook docs. ([#1666](https://github.com/max-sixty/worktrunk/pull/1666))
+
+### Internal
+
+- Renamed internal `select` module to `picker`. ([#1650](https://github.com/max-sixty/worktrunk/pull/1650))
-- **Directional template variables for hooks**: New `{{ base }}`, `{{ base_worktree_path }}`, `{{ target }}`, `{{ target_worktree_path }}`, and `{{ cwd }}` variables give hooks explicit access to both sides of two-worktree operations (switch, merge, remove). Bare variables (`branch`, `worktree_path`, `commit`) consistently point to the active branch — the destination for switch/create, the source for merge/remove. ([#1655](https://github.com/max-sixty/worktrunk/pull/1655), [#1660](https://github.com/max-sixty/worktrunk/pull/1660), [#1663](https://github.com/max-sixty/worktrunk/pull/1663))
+- Consolidated merge/remove removal validation. ([#1625](https://github.com/max-sixty/worktrunk/pull/1625))
## 0.30.1
diff --git a/Cargo.lock b/Cargo.lock
index c66c097e4..b7c9b8e27 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -3202,7 +3202,7 @@ checksum = "d7249219f66ced02969388cf2bb044a09756a083d0fab1e566056b04d9fbcaa5"
[[package]]
name = "worktrunk"
-version = "0.30.1"
+version = "0.31.0"
dependencies = [
"ansi-str",
"ansi-to-html",
diff --git a/Cargo.toml b/Cargo.toml
index 87eed2a04..cdaf390ce 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -5,7 +5,7 @@ default-members = [".", "tests/helpers/mock-stub"]
[package]
name = "worktrunk"
-version = "0.30.1"
+version = "0.31.0"
edition = "2024"
rust-version = "1.89"
build = "build.rs"
diff --git a/docs/content/remove.md b/docs/content/remove.md
index 0ed78e35f..7c4cbc404 100644
--- a/docs/content/remove.md
+++ b/docs/content/remove.md
@@ -79,6 +79,10 @@ Removal runs in the background by default (returns immediately). Logs are writte
`pre-remove` hooks run before the worktree is deleted (with access to worktree files). `post-remove` hooks run after removal. See [`wt hook`](@/hook.md) for configuration.
+## Detached HEAD worktrees
+
+Detached worktrees have no branch name, so they can't be removed by branch. Pass the worktree path instead: `wt remove /path/to/worktree`.
+
## See also
- [`wt merge`](@/merge.md) — Remove worktree after merging
@@ -95,7 +99,7 @@ Usage: <b><span class=c>wt remove</span></b> <span class=c>[OPTIONS]</span> <spa
<b><span class=g>Arguments:</span></b>
<span class=c>[BRANCHES]...</span>
- Branch name [default: current]
+ Branch name or path [default: current]
<b><span class=g>Options:</span></b>
<b><span class=c>--no-delete-branch</span></b>
diff --git a/skills/worktrunk/SKILL.md b/skills/worktrunk/SKILL.md
index 1b3a7da43..b3f3b2701 100644
--- a/skills/worktrunk/SKILL.md
+++ b/skills/worktrunk/SKILL.md
@@ -1,7 +1,7 @@
---
name: worktrunk
description: Guidance for Worktrunk, a CLI tool for managing git worktrees. Covers configuration (user config at ~/.config/worktrunk/config.toml and project hooks at .config/wt.toml), usage, and troubleshooting. Use for "setting up commit message generation", "configuring hooks", "automating tasks", or general worktrunk questions.
-version: 0.30.1
+version: 0.31.0
license: MIT OR Apache-2.0
compatibility: Requires worktrunk CLI (https://worktrunk.dev)
---
diff --git a/skills/worktrunk/reference/remove.md b/skills/worktrunk/reference/remove.md
index dbd480c24..02d22f388 100644
--- a/skills/worktrunk/reference/remove.md
+++ b/skills/worktrunk/reference/remove.md
@@ -70,6 +70,10 @@ Removal runs in the background by default (returns immediately). Logs are writte
`pre-remove` hooks run before the worktree is deleted (with access to worktree files). `post-remove` hooks run after removal. See [`wt hook`](https://worktrunk.dev/hook/) for configuration.
+## Detached HEAD worktrees
+
+Detached worktrees have no branch name, so they can't be removed by branch. Pass the worktree path instead: `wt remove /path/to/worktree`.
+
## Command reference
wt remove - Remove worktree; delete branch if merged
@@ -80,7 +84,7 @@ Usage: <b><span class=c>wt remove</span></b> <span class=c>[OPTIONS]</span> <spa
<b><span class=g>Arguments:</span></b>
<span class=c>[BRANCHES]...</span>
- Branch name [default: current]
+ Branch name or path [default: current]
<b><span class=g>Options:</span></b>
<b><span class=c>--no-delete-branch</span></b>
diff --git a/src/cli/mod.rs b/src/cli/mod.rs
index 08f41c63e..a3319ceca 100644
--- a/src/cli/mod.rs
+++ b/src/cli/mod.rs
@@ -818,13 +818,17 @@ Removal runs in the background by default (returns immediately). Logs are writte
`pre-remove` hooks run before the worktree is deleted (with access to worktree files). `post-remove` hooks run after removal. See [`wt hook`](@/hook.md) for configuration.
+## Detached HEAD worktrees
+
+Detached worktrees have no branch name, so they can't be removed by branch. Pass the worktree path instead: `wt remove /path/to/worktree`.
+
## See also
- [`wt merge`](@/merge.md) — Remove worktree after merging
- [`wt list`](@/list.md) — View all worktrees
"#)]
Remove {
- /// Branch name [default: current]
+ /// Branch name or path [default: current]
#[arg(add = crate::completion::local_branches_completer())]
branches: Vec<String>,
diff --git a/src/commands/mod.rs b/src/commands/mod.rs
index 853d0c179..50ee13f00 100644
--- a/src/commands/mod.rs
+++ b/src/commands/mod.rs
@@ -48,8 +48,8 @@ pub(crate) use step_commands::{
step_commit, step_copy_ignored, step_diff, step_prune, step_relocate, step_show_squash_prompt,
};
pub(crate) use worktree::{
- OperationMode, handle_remove, handle_remove_current, is_worktree_at_expected_path,
- resolve_worktree_arg, worktree_display_name,
+ OperationMode, handle_remove, handle_remove_current, handle_remove_path,
+ is_worktree_at_expected_path, resolve_worktree_arg, worktree_display_name,
};
// Re-export Shell from the canonical location
diff --git a/src/commands/picker/mod.rs b/src/commands/picker/mod.rs
index 36fbe99aa..8e00e801d 100644
--- a/src/commands/picker/mod.rs
+++ b/src/commands/picker/mod.rs
@@ -22,7 +22,7 @@ use super::handle_switch::{
};
use super::list::collect;
use super::worktree::{
- SwitchBranchInfo, SwitchResult, execute_switch, handle_remove,
+ SwitchBranchInfo, SwitchResult, execute_switch, handle_remove, handle_remove_path,
offer_bare_repo_worktree_path_fix, path_mismatch, plan_switch,
};
use crate::output::{handle_remove_output, handle_switch_output};
@@ -334,23 +334,36 @@ pub fn handle_picker(
match action {
PickerAction::Remove => {
- // Get the selected worktree's branch name
- let selected_name = out
- .selected_items
- .first()
- .map(|item| item.output().to_string());
- let branch_name = resolve_identifier(&action, String::new(), selected_name)?;
+ let selected = out.selected_items.first().context("No worktree selected")?;
+
+ // Access the underlying worktree data to determine removal strategy
+ let worktree_data = selected
+ .as_any()
+ .downcast_ref::<WorktreeSkimItem>()
+ .and_then(|skim_item| skim_item.item.worktree_data());
let config = repo.user_config();
// Safe removal: no force-delete (-D), no force-worktree (-f)
- let result = handle_remove(
- &branch_name,
- false, // keep_branch: delete branch (default behavior)
- false, // force_delete: no -D
- false, // force_worktree: no -f
- config,
- )
+ let result = if let Some(data) = worktree_data.filter(|d| d.detached) {
+ // Detached worktrees have no branch name — remove by path
+ // (same as `wt remove /path/to/worktree` from the CLI)
+ handle_remove_path(
+ &data.path, false, // keep_branch: delete branch (default behavior)
+ false, // force_delete: no -D
+ false, // force_worktree: no -f
+ config,
+ )
+ } else {
+ let branch_name = selected.output().to_string();
+ handle_remove(
+ &branch_name,
+ false, // keep_branch: delete branch (default behavior)
+ false, // force_delete: no -D
+ false, // force_worktree: no -f
+ config,
+ )
+ }
.context("Failed to remove worktree")?;
// Execute removal in foreground, no hooks, not quiet
diff --git a/src/commands/worktree/mod.rs b/src/commands/worktree/mod.rs
index dcfaf62e2..2aa0fecf0 100644
--- a/src/commands/worktree/mod.rs
+++ b/src/commands/worktree/mod.rs
@@ -87,7 +87,7 @@ mod types;
// Re-export public types and functions
pub use push::{handle_no_ff_merge, handle_push};
-pub use remove::{handle_remove, handle_remove_current};
+pub use remove::{handle_remove, handle_remove_current, handle_remove_path};
pub(crate) use resolve::paths_match;
pub use resolve::{
compute_worktree_path, is_worktree_at_expected_path, offer_bare_repo_worktree_path_fix,
diff --git a/src/commands/worktree/remove.rs b/src/commands/worktree/remove.rs
index 5bf2750ca..a991206bf 100644
--- a/src/commands/worktree/remove.rs
+++ b/src/commands/worktree/remove.rs
@@ -25,6 +25,24 @@ pub fn handle_remove(
)
}
+/// Remove a worktree by path (supports detached HEAD worktrees).
+pub fn handle_remove_path(
+ path: &std::path::Path,
+ keep_branch: bool,
+ force_delete: bool,
+ force_worktree: bool,
+ config: &UserConfig,
+) -> anyhow::Result<RemoveResult> {
+ let repo = Repository::current()?;
+
+ repo.prepare_worktree_removal(
+ RemoveTarget::Path(path),
+ BranchDeletionMode::from_flags(keep_branch, force_delete),
+ force_worktree,
+ config,
+ )
+}
+
/// Handle removing the current worktree (supports detached HEAD state).
///
/// This is the path-based removal that handles the "@" shorthand, including
diff --git a/src/commands/worktree/resolve.rs b/src/commands/worktree/resolve.rs
index 68a7e73d8..23993fa41 100644
--- a/src/commands/worktree/resolve.rs
+++ b/src/commands/worktree/resolve.rs
@@ -5,6 +5,7 @@
use std::io::IsTerminal;
use std::path::{Path, PathBuf};
+use anyhow::Context;
use color_print::cformat;
use dunce::canonicalize;
use normalize_path::NormalizePath;
@@ -25,13 +26,15 @@ use super::types::OperationMode;
/// 1. Special symbols ("@", "-", "^") are handled specially
/// 2. Resolve argument as branch name
/// 3. If branch has a worktree, return it
-/// 4. Otherwise, return branch-only (no worktree)
+/// 4. For `Remove`: fall back to path-based lookup (supports detached worktrees)
+/// 5. Otherwise, return branch-only (no worktree)
///
/// For `CreateOrSwitch` context: If the branch has no worktree but expected
/// path is occupied by another branch's worktree, an error is raised.
///
-/// For `Remove` context: Path occupation is ignored since we're not creating
-/// a worktree - we just return `BranchOnly` if no worktree exists.
+/// For `Remove` context: If branch lookup fails to find a worktree, the
+/// argument is tried as a filesystem path (absolute or relative to CWD).
+/// This supports removing detached HEAD worktrees which have no branch name.
pub fn resolve_worktree_arg(
repo: &Repository,
name: &str,
@@ -71,6 +74,25 @@ pub fn resolve_worktree_arg(
}
}
+ // For Remove: fall back to path-based lookup (supports detached worktrees)
+ if context == OperationMode::Remove {
+ let candidate = Path::new(name);
+ // Try as absolute path, or resolve relative to CWD
+ let abs_path = if candidate.is_absolute() {
+ candidate.to_path_buf()
+ } else {
+ std::env::current_dir()
+ .context("Failed to determine current directory")?
+ .join(candidate)
+ };
+ if let Some((path, wt_branch)) = repo.worktree_at_path(&abs_path)? {
+ return Ok(ResolvedWorktree::Worktree {
+ path,
+ branch: wt_branch,
+ });
+ }
+ }
+
// No worktree for branch (and path not occupied, or we don't care about path)
Ok(ResolvedWorktree::BranchOnly { branch })
}
diff --git a/src/main.rs b/src/main.rs
index 3b2f03f31..46d6d803d 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -49,8 +49,8 @@ use commands::{
clear_approvals, handle_completions, handle_config_create, handle_config_show,
handle_config_update, handle_configure_shell, handle_hints_clear, handle_hints_get,
handle_hook_show, handle_init, handle_list, handle_logs_get, handle_merge, handle_promote,
- handle_rebase, handle_remove, handle_remove_current, handle_show_theme, handle_squash,
- handle_state_clear, handle_state_clear_all, handle_state_get, handle_state_set,
+ handle_rebase, handle_remove, handle_remove_current, handle_remove_path, handle_show_theme,
+ handle_squash, handle_state_clear, handle_state_clear_all, handle_state_get, handle_state_set,
handle_state_show, handle_switch, handle_unconfigure_shell, resolve_worktree_arg, run_hook,
step_commit, step_copy_ignored, step_diff, step_eval, step_for_each, step_prune, step_relocate,
};
@@ -630,12 +630,14 @@ fn validate_remove_targets(
continue;
}
- // Non-current worktree - branch is always Some because:
- // - "@" resolves to current worktree (handled by is_current branch above)
- // - Other names resolve via resolve_worktree_arg which always sets branch: Some(...)
- let branch_for_remove = branch.as_ref().unwrap();
-
- match handle_remove(branch_for_remove, keep_branch, force_delete, force, config) {
+ // Non-current worktree: remove by branch name, or by path for
+ // detached worktrees (which have no branch).
+ let result = if let Some(ref branch_name) = branch {
+ handle_remove(branch_name, keep_branch, force_delete, force, config)
+ } else {
+ handle_remove_path(&path_canonical, keep_branch, force_delete, force, config)
+ };
+ match result {
Ok(result) => plans.others.push(result),
Err(e) => plans.record_error(e),
}
diff --git a/tests/integration_tests/remove.rs b/tests/integration_tests/remove.rs
index 530fb1006..ffa7cb2c2 100644
--- a/tests/integration_tests/remove.rs
+++ b/tests/integration_tests/remove.rs
@@ -1813,6 +1813,36 @@ fn test_remove_detached_worktree_in_multi(mut repo: TestRepo) {
));
}
+/// Reproduces #1661: "(detached)" is not a valid branch name — verify it fails.
+#[rstest]
+fn test_remove_detached_by_name_fails(mut repo: TestRepo) {
+ repo.add_worktree("feature-detached");
+ repo.detach_head_in_worktree("feature-detached");
+
+ // "(detached)" is not a branch name — this should fail
+ assert_cmd_snapshot!(make_snapshot_cmd(&repo, "remove", &["(detached)"], None));
+}
+
+/// Verify that detached worktrees can be removed by path (#1661).
+/// This ensures the CLI supports the same operation the picker uses.
+#[rstest]
+fn test_remove_detached_worktree_by_path(mut repo: TestRepo) {
+ repo.add_worktree("feature-detached");
+ repo.detach_head_in_worktree("feature-detached");
+
+ let worktree_path = repo
+ .worktree_path("feature-detached")
+ .to_string_lossy()
+ .to_string();
+
+ assert_cmd_snapshot!(make_snapshot_cmd(
+ &repo,
+ "remove",
+ &[&worktree_path, "--foreground", "--yes"],
+ None,
+ ));
+}
+
/// Test that resolve_worktree("@") works when the worktree is accessed via a symlink.
///
/// This tests the path normalization fix where:
diff --git a/tests/snapshots/integration__integration_tests__help__help_remove_long.snap b/tests/snapshots/integration__integration_tests__help__help_remove_long.snap
index adf2ab5b5..f7d64593d 100644
--- a/tests/snapshots/integration__integration_tests__help__help_remove_long.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_remove_long.snap
@@ -39,7 +39,7 @@ Usage: wt remove [OPTIONS] [BRANCHES]...
Arguments:
[BRANCHES]...
- Branch name [default: current]
+ Branch name or path [default: current]
Options:
--no-delete-branch
@@ -134,6 +134,10 @@ Removal runs in the background by default (returns immediately). Logs are writte
pre-remove hooks run before the worktree is deleted (with access to worktree files). post-remove hooks run after removal. See wt hook for configuration.
+Detached HEAD worktrees
+
+Detached worktrees have no branch name, so they can't be removed by branch. Pass the worktree path instead: wt remove /path/to/worktree.
+
See also
- wt merge — Remove worktree after merging
diff --git a/tests/snapshots/integration__integration_tests__help__help_remove_short.snap b/tests/snapshots/integration__integration_tests__help__help_remove_short.snap
index 164f3f509..2494b1437 100644
--- a/tests/snapshots/integration__integration_tests__help__help_remove_short.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_remove_short.snap
@@ -36,7 +36,7 @@ wt remove - Remove worktree; delete branch if merged
Usage: wt remove [OPTIONS] [BRANCHES]...
Arguments:
- [BRANCHES]... Branch name [default: current]
+ [BRANCHES]... Branch name or path [default: current]
Options:
--no-delete-branch Keep branch after removal
diff --git a/tests/snapshots/integration__integration_tests__remove__remove_detached_by_name_fails.snap b/tests/snapshots/integration__integration_tests__remove__remove_detached_by_name_fails.snap
new file mode 100644
index 000000000..8b796da76
--- /dev/null
+++ b/tests/snapshots/integration__integration_tests__remove__remove_detached_by_name_fails.snap
@@ -0,0 +1,46 @@
+---
+source: tests/integration_tests/remove.rs
+info:
+ program: wt
+ args:
+ - remove
+ - (detached)
+ env:
+ APPDATA: "[TEST_CONFIG_HOME]"
+ CLICOLOR_FORCE: "1"
+ COLUMNS: "500"
+ GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"
+ GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
+ GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"
+ GIT_CONFIG_SYSTEM: /dev/null
+ GIT_EDITOR: ""
+ GIT_TERMINAL_PROMPT: "0"
+ HOME: "[TEST_HOME]"
+ LANG: C
+ LC_ALL: C
+ MOCK_CONFIG_DIR: "[MOCK_CONFIG_DIR]"
+ NO_COLOR: ""
+ PATH: "[PATH]"
+ PSModulePath: ""
+ RUST_LOG: warn
+ SHELL: ""
+ TERM: alacritty
+ USERPROFILE: "[TEST_HOME]"
+ WORKTRUNK_APPROVALS_PATH: "[TEST_APPROVALS]"
+ WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
+ WORKTRUNK_SYSTEM_CONFIG_PATH: "[TEST_SYSTEM_CONFIG]"
+ WORKTRUNK_TEST_CLAUDE_INSTALLED: "0"
+ WORKTRUNK_TEST_DELAYED_STREAM_MS: "-1"
+ WORKTRUNK_TEST_EPOCH: "1735776000"
+ WORKTRUNK_TEST_NUSHELL_ENV: "0"
+ WORKTRUNK_TEST_POWERSHELL_ENV: "0"
+ WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
+ XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"
+---
+success: false
+exit_code: 1
+----- stdout -----
+
+----- stderr -----
+✗ No branch named (detached)
+↳ To list branches, run wt list --branches --remotes
diff --git a/tests/snapshots/integration__integration_tests__remove__remove_detached_worktree_by_path.snap b/tests/snapshots/integration__integration_tests__remove__remove_detached_worktree_by_path.snap
new file mode 100644
index 000000000..31d9dae47
--- /dev/null
+++ b/tests/snapshots/integration__integration_tests__remove__remove_detached_worktree_by_path.snap
@@ -0,0 +1,48 @@
+---
+source: tests/integration_tests/remove.rs
+info:
+ program: wt
+ args:
+ - remove
+ - /tmp/.tmph0CPwB/repo.feature-detached
+ - "--foreground"
+ - "--yes"
+ env:
+ APPDATA: "[TEST_CONFIG_HOME]"
+ CLICOLOR_FORCE: "1"
+ COLUMNS: "500"
+ GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"
+ GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
+ GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"
+ GIT_CONFIG_SYSTEM: /dev/null
+ GIT_EDITOR: ""
+ GIT_TERMINAL_PROMPT: "0"
+ HOME: "[TEST_HOME]"
+ LANG: C
+ LC_ALL: C
+ MOCK_CONFIG_DIR: "[MOCK_CONFIG_DIR]"
+ NO_COLOR: ""
+ PATH: "[PATH]"
+ PSModulePath: ""
+ RUST_LOG: warn
+ SHELL: ""
+ TERM: alacritty
+ USERPROFILE: "[TEST_HOME]"
+ WORKTRUNK_APPROVALS_PATH: "[TEST_APPROVALS]"
+ WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
+ WORKTRUNK_SYSTEM_CONFIG_PATH: "[TEST_SYSTEM_CONFIG]"
+ WORKTRUNK_TEST_CLAUDE_INSTALLED: "0"
+ WORKTRUNK_TEST_DELAYED_STREAM_MS: "-1"
+ WORKTRUNK_TEST_EPOCH: "1735776000"
+ WORKTRUNK_TEST_NUSHELL_ENV: "0"
+ WORKTRUNK_TEST_POWERSHELL_ENV: "0"
+ WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
+ XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"
+---
+success: true
+exit_code: 0
+----- stdout -----
+
+----- stderr -----
+◎ Removing worktree @ _REPO_.feature-detached... (detached HEAD, no branch to delete)
+✓ Removed worktree @ _REPO_.feature-detached (detached HEAD, no branch to delete)