fix: guard cd in formula_worktree_setup with || return (SC2164)
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/pr/ci Pipeline was successful

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Claude 2026-03-28 13:16:29 +00:00
parent de2e7dc1fb
commit ab5f96dc96

View file

@ -310,7 +310,7 @@ build_sdk_prompt_footer() {
# Requires globals: PROJECT_REPO_ROOT, PRIMARY_BRANCH. # Requires globals: PROJECT_REPO_ROOT, PRIMARY_BRANCH.
formula_worktree_setup() { formula_worktree_setup() {
local worktree="$1" local worktree="$1"
cd "$PROJECT_REPO_ROOT" cd "$PROJECT_REPO_ROOT" || return
git fetch origin "$PRIMARY_BRANCH" 2>/dev/null || true git fetch origin "$PRIMARY_BRANCH" 2>/dev/null || true
worktree_cleanup "$worktree" worktree_cleanup "$worktree"
git worktree add "$worktree" "origin/${PRIMARY_BRANCH}" --detach 2>/dev/null git worktree add "$worktree" "origin/${PRIMARY_BRANCH}" --detach 2>/dev/null