Skip to content

Commit 023f13c

Browse files
LeeCampbellclaude
andcommitted
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) <noreply@anthropic.com>
1 parent 13798f8 commit 023f13c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

scripts/synch-git.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ git fetch upstream --prune
1313

1414
echo ""
1515
echo "=== Deleting local branches merged into main ==="
16-
merged=$(git branch --merged main | grep -v '^\*\|main' || true)
16+
merged=$(git branch --merged main | grep -v '^\*\|^+\|main' || true)
1717
if [ -n "$merged" ]; then
1818
echo "$merged" | xargs git branch -d
1919
else

0 commit comments

Comments
 (0)