Worktrunk is a CLI for Git worktree management, designed for parallel AI agent workflows
feat: Add hint for deleting unmerged branches
Maximilian Roos73012139945a
diff --git a/src/output/handlers.rs b/src/output/handlers.rsindex 47574d422..c503bf1af 100644--- a/src/output/handlers.rs+++ b/src/output/handlers.rs@@ -9,7 +9,7 @@ use worktrunk::git::GitError;use worktrunk::git::Repository;use worktrunk::path::format_path_for_display;use worktrunk::shell::Shell;-use worktrunk::styling::format_with_gutter;+use worktrunk::styling::{HINT_EMOJI, format_with_gutter};/// Format a switch success message with a consistent location phrase///@@ -146,6 +146,9 @@ fn handle_branch_deletion_result(super::info(cformat!("Branch <bold>{branch_name}</> retained; has unmerged changes"))?;+ super::print(cformat!(+ "{HINT_EMOJI} <dim>Use </>wt remove -D<dim> to delete unmerged branches</>"+ ))?;Ok(None)}Err(e) => {@@ -533,6 +536,13 @@ fn handle_removed_worktree_output(};super::progress(action)?;+ // Show hint for unmerged branches (same as synchronous path)+ if !no_delete_branch && !should_delete_branch {+ super::print(cformat!(+ "{HINT_EMOJI} <dim>Use </>wt remove -D<dim> to delete unmerged branches</>"+ ))?;+ }+// Build command with the decision we already madelet remove_command =build_remove_command(worktree_path, should_delete_branch.then_some(branch_name));diff --git a/tests/snapshots/integration__integration_tests__remove__remove_branch_not_fully_merged.snap b/tests/snapshots/integration__integration_tests__remove__remove_branch_not_fully_merged.snapindex bf22460f9..d25d89ecf 100644--- a/tests/snapshots/integration__integration_tests__remove__remove_branch_not_fully_merged.snap+++ b/tests/snapshots/integration__integration_tests__remove__remove_branch_not_fully_merged.snap@@ -24,3 +24,4 @@ exit_code: 0----- stderr -----π [36m[36mRemoving [1mfeature-unmerged[22m worktree in background; retaining unmerged branch[39m[39m+π‘ [2mUse [22mwt remove -D[2m to delete unmerged branches[22mdiff --git a/tests/snapshots/integration__integration_tests__remove__remove_branch_only_unmerged.snap b/tests/snapshots/integration__integration_tests__remove__remove_branch_only_unmerged.snapindex 76d1cd214..d1a71698f 100644--- a/tests/snapshots/integration__integration_tests__remove__remove_branch_only_unmerged.snap+++ b/tests/snapshots/integration__integration_tests__remove__remove_branch_only_unmerged.snap@@ -25,3 +25,4 @@ exit_code: 0----- stderr -----π‘ [33mNo worktree found for branch [1mfeature-unmerged[22m[39mβͺ Branch [1mfeature-unmerged[22m retained; has unmerged changes+π‘ [2mUse [22mwt remove -D[2m to delete unmerged branches[22m