fix(#2498): pass --no-track when branching off origin/$DEFAULT_BRANCH (#2628)

* test(#2498): guard branch-creation uses --no-track (all workflows)

* fix(#2498): pass --no-track when branching off origin/$DEFAULT_BRANCH

* chore(#2498): backfill changeset pr to 2628
This commit is contained in:
Tom Boucher
2026-07-24 22:49:29 -04:00
committed by GitHub
parent 57b2bd8368
commit c2b498e452
24 changed files with 108 additions and 45 deletions

View File

@@ -236,7 +236,11 @@ else
# On success HEAD is exactly at origin/$DEFAULT_BRANCH, so a post-creation
# merge-base / "ahead-of" guard would be unreachable — the explicit base
# argument here is the single source of correctness for #2916.
git checkout -b "$branch_name" "origin/$DEFAULT_BRANCH" \
# --no-track: with the default branch.autoSetupMerge=true, checkout -b from a
# remote-tracking ref wires branch.<name>.merge to refs/heads/$DEFAULT_BRANCH
# (origin/master), so a GUI sync pushes quick-task commits straight onto
# origin/$DEFAULT_BRANCH, bypassing PR review (#2498).
git checkout -b "$branch_name" "origin/$DEFAULT_BRANCH" --no-track \
|| { echo "ERROR: Could not create '$branch_name' from origin/$DEFAULT_BRANCH (#2916)." >&2; exit 1; }
fi
```