flake-update-cascade: fix stale tracking ref on force-push (v2) #17
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "agent/cascade-fix-stale-push-v2"
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?
The previous fix (
fetch || true) was insufficient: when the remote branch is gone, the fetch fails silently but leaves the stale local tracking ref intact.--force-with-leasethen rejects the push because the stale ref contradicts the absent remote.Fix: when the fetch fails (branch no longer exists), explicitly delete the stale tracking ref with
git update-ref -d. Then--force-with-leasesees no tracking ref and pushes cleanly.