fix: call resolve_forge_remote before formula_worktree_setup in supervisor-run.sh (implements #1120) (#1121)
Make formula_worktree_setup() self-heal: if FORGE_REMOTE is unset, call resolve_forge_remote() automatically. This eliminates the class of bug where a caller forgets the precondition, rather than patching one caller. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
d368f904fb
commit
8c1ca922a9
1 changed files with 5 additions and 2 deletions
|
|
@ -792,10 +792,13 @@ build_sdk_prompt_footer() {
|
|||
# Creates an isolated worktree for synchronous formula execution.
|
||||
# Fetches primary branch, cleans stale worktree, creates new one, and
|
||||
# sets an EXIT trap for cleanup.
|
||||
# Requires globals: PROJECT_REPO_ROOT, PRIMARY_BRANCH, FORGE_REMOTE.
|
||||
# Ensure resolve_forge_remote() is called before this function.
|
||||
# Requires globals: PROJECT_REPO_ROOT, PRIMARY_BRANCH.
|
||||
# Calls resolve_forge_remote() automatically if FORGE_REMOTE is unset.
|
||||
formula_worktree_setup() {
|
||||
local worktree="$1"
|
||||
if [ -z "${FORGE_REMOTE:-}" ]; then
|
||||
resolve_forge_remote
|
||||
fi
|
||||
cd "$PROJECT_REPO_ROOT" || return
|
||||
git fetch "${FORGE_REMOTE}" "$PRIMARY_BRANCH" 2>/dev/null || true
|
||||
worktree_cleanup "$worktree"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue