flake-update-cascade: fix stale tracking ref on force-push (v2) #17

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

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-lease then 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-lease sees no tracking ref and pushes cleanly.

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-lease` then 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-lease` sees no tracking ref and pushes cleanly.
vnprc approved these changes 2026-06-03 23:49:07 +01:00
vnprc merged commit f7372494f4 into master 2026-06-03 23:49:15 +01:00
vnprc deleted branch agent/cascade-fix-stale-push-v2 2026-06-03 23:49:15 +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!17
No description provided.