Skip to content

fix(land-branch): fallback to PR when default branch push is protected#93

Merged
danielvm-git merged 2 commits into
mainfrom
fix/land-branch-protected
Jul 25, 2026
Merged

fix(land-branch): fallback to PR when default branch push is protected#93
danielvm-git merged 2 commits into
mainfrom
fix/land-branch-protected

Conversation

@danielvm-git

Copy link
Copy Markdown
Owner

Summary

  • Extract push helpers into scripts/lib/land-branch-push.sh (is_protected_branch_rejection, land_push_default_branch, land_fallback_to_pr).
  • On GH006 / "Changes must be made through a pull request", land-branch.sh now creates a land-recovery/<feature> branch at the squash commit, resets local default to origin, pushes the recovery branch, and runs gh pr create.
  • When gh fails, the script prints exact manual recovery commands and exits non-zero.
  • Add tests/test-land-branch-protected.sh with detector fixtures and a temp bare remote using a rejecting pre-receive hook.

Test plan

  • bash tests/test-land-branch-protected.sh — 11/11 passed
  • npm run compliance && bash scripts/run-verification-gates.sh — Golden 12/12 PASS

Closes #92

Made with Cursor

Detect GH006 / PR-required push rejections after squash-merge, recover via
land-recovery branch + gh pr create, and print manual recovery steps when gh fails.

Closes #92

Co-authored-by: Cursor <cursoragent@cursor.com>
@cursor

cursor Bot commented Jul 25, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

Co-authored-by: Cursor <cursoragent@cursor.com>
@danielvm-git
danielvm-git merged commit d7f14d4 into main Jul 25, 2026
1 check passed
github-actions Bot pushed a commit that referenced this pull request Jul 25, 2026
# [2.85.0](v2.84.1...v2.85.0) (2026-07-25)

### Bug Fixes

* **land-branch:** fallback to PR when default branch push is protected ([#93](#93)) ([d7f14d4](d7f14d4)), closes [#92](#92)

### Features

* **skills:** adopt Agentic STE controlled English for instructional prose ([#94](#94)) ([79fca7f](79fca7f))
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 2.85.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

danielvm-git added a commit that referenced this pull request Jul 25, 2026
Record closure of #92 and #91 after squash merges of PRs #93 and #94;
clear dispatch-agents parallel handoff.

Co-authored-by: Cursor <cursoragent@cursor.com>
@danielvm-git
danielvm-git deleted the fix/land-branch-protected branch July 25, 2026 05:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

solo-git land-branch.sh fails ungracefully against a protected-branch (PR-required) repo, leaving a stranded local commit

1 participant