Repository navigation
fix(forge): encode the branch name in the GitHub ref URL - #1267
Merged
Merged
Conversation
BryanFRD
enabled auto-merge (squash)
October 4, 2026 17:07
Contributor
There was a problem hiding this comment.
Looks correct. percent_encode_path leaves / alone, which is right for refs/heads/release/x, and encodes #, ? and %. The only other byte it leaves alone that matters is :, and git already rejects that in ref names. The create fallback still sends the raw name in the JSON body, and the test covers both requests.
Nit: forge code now borrows a helper from the JS config loader through crate::config. If a third caller turns up, a small shared url util would be a better home for it.
ferrflow Bot
added a commit
that referenced
this pull request
Oct 4, 2026
## [7.27.4] - 2026-10-04 ### Bug Fixes - fix(forge): encode the branch name in the GitHub ref URL (#1267)
This was referenced Oct 4, 2026
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.
Closes #1266
set_branchbuilt/git/refs/heads/{branch}from the raw branch name, so a#or?cut the URL short and the PATCH went to the wrong ref (follow-up to #1233, raised in the #1261 review). The name now goes throughpercent_encode_path, which already existed for the JS config loader: it keeps/and encodes the rest. It is re-exported fromconfigrather than copied. The POST that creates the ref sends the rawrefs/heads/...in its JSON body, which is correct and unchanged.A test with
release/a#b?cchecks the encoded PATCH path and the raw ref in the create body. It fails without the fix.