From ab5f96dc96ea5173cc09a43068bf2eb7c7617dc2 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 28 Mar 2026 13:16:29 +0000 Subject: [PATCH] fix: guard cd in formula_worktree_setup with || return (SC2164) Co-Authored-By: Claude Opus 4.6 (1M context) --- lib/formula-session.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/formula-session.sh b/lib/formula-session.sh index 7f200c5..7c52035 100644 --- a/lib/formula-session.sh +++ b/lib/formula-session.sh @@ -310,7 +310,7 @@ build_sdk_prompt_footer() { # Requires globals: PROJECT_REPO_ROOT, PRIMARY_BRANCH. formula_worktree_setup() { local worktree="$1" - cd "$PROJECT_REPO_ROOT" + cd "$PROJECT_REPO_ROOT" || return git fetch origin "$PRIMARY_BRANCH" 2>/dev/null || true worktree_cleanup "$worktree" git worktree add "$worktree" "origin/${PRIMARY_BRANCH}" --detach 2>/dev/null