Skip to content

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

Clarify branch cleanup target comparison logic

Maximilian Roos1154ff074470
diff --git a/docs/content/remove.md b/docs/content/remove.md
index 16d3261a3..390e59d43 100644
--- a/docs/content/remove.md
+++ b/docs/content/remove.md
@@ -49,7 +49,7 @@ Worktrunk checks five conditions (in order of cost):
4. **Trees match** — Branch tree SHA equals target tree SHA. Shows `⊂`.
5. **Merge adds nothing** — Simulated merge produces the same tree as target. Handles squash-merged branches where target has advanced. Shows `⊂`.
-Check 1 compares against the default branch. Checks 2-5 compare against **target** — the default branch, or its upstream (for example, `origin/main`) when it's strictly ahead (catching branches merged remotely before pulling).
+The "same commit" check uses the local default branch; for other checks, **target** means the default branch, or its upstream (e.g., `origin/main`) when strictly ahead.
Branches showing `_` or `⊂` are dimmed as safe to delete.
diff --git a/src/cli.rs b/src/cli.rs
index 88fb98266..20a3e55e4 100644
--- a/src/cli.rs
+++ b/src/cli.rs
@@ -2433,7 +2433,7 @@ Worktrunk checks five conditions (in order of cost):
4. **Trees match** — Branch tree SHA equals target tree SHA. Shows `⊂`.
5. **Merge adds nothing** — Simulated merge produces the same tree as target. Handles squash-merged branches where target has advanced. Shows `⊂`.
-Check 1 compares against the default branch. Checks 2-5 compare against **target** — the default branch, or its upstream (for example, `origin/main`) when it's strictly ahead (catching branches merged remotely before pulling).
+The "same commit" check uses the local default branch; for other checks, **target** means the default branch, or its upstream (e.g., `origin/main`) when strictly ahead.
Branches showing `_` or `⊂` are dimmed as safe to delete.
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 26ce79637..6473a9bf3 100644
--- a/tests/snapshots/integration__integration_tests__help__help_remove_long.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_remove_long.snap
@@ -95,8 +95,8 @@ Worktrunk checks five conditions (in order of cost):
4. Trees match — Branch tree SHA equals target tree SHA. Shows ⊂.
5. Merge adds nothing — Simulated merge produces the same tree as target. Handles squash-merged branches where target has advanced. Shows ⊂.
-Check 1 compares against the default branch. Checks 2-5 compare against target — the default branch, or its upstream (for example, origin/main)
-when it's strictly ahead (catching branches merged remotely before pulling).
+The "same commit" check uses the local default branch; for other checks, target means the default branch, or its upstream (e.g., origin/main)
+when strictly ahead.
Branches showing _ or ⊂ are dimmed as safe to delete.