From 8f4fb16a09ff1db7e8cb63ca0f4186c6e51b5e4a Mon Sep 17 00:00:00 2001 From: Hugo Nijhuis Date: Tue, 13 Jan 2026 23:45:37 +0100 Subject: [PATCH] fix(worktrees): fix tea issues title parsing for branch names - tea issues output has title on line 2, not line 1 - Update sed command to extract from correct line - Fixes branches being named "issue-N-" or "issue-N-untitled" Co-Authored-By: Claude Opus 4.5 --- skills/worktrees/scripts/create-worktree.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/skills/worktrees/scripts/create-worktree.sh b/skills/worktrees/scripts/create-worktree.sh index 56341f3..5718dd0 100755 --- a/skills/worktrees/scripts/create-worktree.sh +++ b/skills/worktrees/scripts/create-worktree.sh @@ -27,8 +27,8 @@ case "$MODE" in WORKTREE_NAME="${REPO_NAME}-issue-${ISSUE_NUMBER}" WORKTREE_PATH="${WORKTREES_DIR}/${WORKTREE_NAME}" - # Get issue title for branch name - ISSUE_TITLE=$(tea issues "$ISSUE_NUMBER" 2>/dev/null | grep -i "title" | head -1 | cut -d: -f2- | xargs || echo "untitled") + # Get issue title for branch name (tea issues output has title on line 2: " # #1 Title here") + ISSUE_TITLE=$(tea issues "$ISSUE_NUMBER" 2>/dev/null | sed -n '2p' | sed 's/.*#[0-9]* //' | xargs || echo "untitled") # Create safe branch name BRANCH_NAME="issue-${ISSUE_NUMBER}-$(echo "$ISSUE_TITLE" | tr '[:upper:]' '[:lower:]' | tr ' ' '-' | tr -cd '[:alnum:]-' | cut -c1-50)"