From 212f9d540ec692392a8cee93a2fb14709dc35ee7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C2=ABSergei?= Date: Wed, 13 May 2026 13:12:02 +0300 Subject: [PATCH] fix: avoid positional substitution in clean_gone --- plugins/commit-commands/commands/clean_gone.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/plugins/commit-commands/commands/clean_gone.md b/plugins/commit-commands/commands/clean_gone.md index 57f0b6e3ea..67c3c26e16 100644 --- a/plugins/commit-commands/commands/clean_gone.md +++ b/plugins/commit-commands/commands/clean_gone.md @@ -26,10 +26,10 @@ You need to execute the following bash commands to clean up stale local branches Execute this command: ```bash # Process all [gone] branches, removing '+' prefix if present - git branch -v | grep '\[gone\]' | sed 's/^[+* ]//' | awk '{print $1}' | while read branch; do + git branch -v | grep '\[gone\]' | sed 's/^[+* ]//; s/[[:space:]].*$//' | while read branch; do echo "Processing branch: $branch" # Find and remove worktree if it exists - worktree=$(git worktree list | grep "\\[$branch\\]" | awk '{print $1}') + worktree=$(git worktree list | grep "\\[$branch\\]" | sed 's/[[:space:]].*$//') if [ ! -z "$worktree" ] && [ "$worktree" != "$(git rev-parse --show-toplevel)" ]; then echo " Removing worktree: $worktree" git worktree remove --force "$worktree" @@ -50,4 +50,3 @@ After executing these commands, you will: - Provide feedback on which worktrees and branches were removed If no branches are marked as [gone], report that no cleanup was needed. -