From 1e07a29da9bf4b4f6913fd76f7765470c6262cd5 Mon Sep 17 00:00:00 2001 From: Lee Campbell Date: Mon, 30 Mar 2026 10:12:19 +0800 Subject: [PATCH] fix: exclude worktree branches from merged-branch cleanup in synch-git Branches checked out in a worktree are prefixed with `+` in `git branch` output. Without filtering these, the cleanup step would attempt to delete them and fail. Co-Authored-By: Claude Opus 4.6 (1M context) --- scripts/synch-git.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/synch-git.sh b/scripts/synch-git.sh index a4e00b6..6629324 100644 --- a/scripts/synch-git.sh +++ b/scripts/synch-git.sh @@ -13,7 +13,7 @@ git fetch upstream --prune echo "" echo "=== Deleting local branches merged into main ===" -merged=$(git branch --merged main | grep -v '^\*\|main' || true) +merged=$(git branch --merged main | grep -v '^\*\|^+\|main' || true) if [ -n "$merged" ]; then echo "$merged" | xargs git branch -d else