fix: guard cd in formula_worktree_setup with || return (SC2164)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
de2e7dc1fb
commit
ab5f96dc96
1 changed files with 1 additions and 1 deletions
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue