flake-update-cascade: fix stale tracking ref on force-push #16

Merged
vnprc merged 1 commit from agent/cascade-fix-stale-push into master 2026-06-03 23:44:36 +01:00
Member

After a PR branch is merged and deleted on the remote, the local tracking ref becomes stale. --force-with-lease then rejects the push because the local ref doesn't match what's actually on the remote (nothing).

Fix: fetch the remote branch before force-pushing. If the branch doesn't exist, the fetch quietly fails (|| true) and the push creates it fresh. If it exists, the tracking ref is refreshed and --force-with-lease works correctly.

After a PR branch is merged and deleted on the remote, the local tracking ref becomes stale. `--force-with-lease` then rejects the push because the local ref doesn't match what's actually on the remote (nothing). Fix: fetch the remote branch before force-pushing. If the branch doesn't exist, the fetch quietly fails (`|| true`) and the push creates it fresh. If it exists, the tracking ref is refreshed and `--force-with-lease` works correctly.
vnprc approved these changes 2026-06-03 23:44:27 +01:00
vnprc merged commit 97b57e1df2 into master 2026-06-03 23:44:36 +01:00
vnprc deleted branch agent/cascade-fix-stale-push 2026-06-03 23:44:36 +01:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Allod/tools!16
No description provided.