Repository navigation
fix(update): lease the template-update push against the fetched branch - #22
Merged
Merged
Conversation
A bare --force-with-lease to a URL has no remote-tracking ref to compare against, so the push is refused with "stale info" whenever the update branch already exists. Lease against the ref checkout fetched instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
template-update.ymlfails every week once its update branch exists. It pushes with a bare--force-with-leaseto a URL rather than toorigin, so git has no remote-tracking ref to lease against and refuses the push withstale info.Both consumers are stuck on this. llm-prices and logfile-upload each had one run that pushed
chore/template-updatebut couldn't open the PR (the Actions pull-request setting was off, see #21). Every run since has failed at the push, for example llm-prices run 37323803351:The fix leases against
refs/remotes/origin/$BRANCH, which checkout's full fetch already populates. An empty value means the branch must not exist yet. python-project-template has the same step and gets the same fix in Generality-Labs/python-project-template#12.Testing
I reproduced it against a local bare remote, with the remote-tracking refs fetched the way checkout fetches them:
stale info. The new one force-pushes.actionlint and
zizmor --offline --persona=auditorare clean on the file.Both this PR and #21 add to
[Unreleased], so whichever merges second needs a one-line rebase.🤖 Generated with Claude Code