flake-update-cascade: fix stale tracking ref on force-push #16
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "agent/cascade-fix-stale-push"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
After a PR branch is merged and deleted on the remote, the local tracking ref becomes stale.
--force-with-leasethen 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-leaseworks correctly.