Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

create_ref: match start of input #1336

Merged
merged 1 commit into from
May 11, 2021
Merged

create_ref: match start of input #1336

merged 1 commit into from
May 11, 2021

Conversation

thepwagner
Copy link
Contributor

/repos/{owner}/{repo}/git/refs states

Required. The name of the fully qualified reference (ie: refs/heads/master). If it doesn't start with 'refs' and have at least two slashes, it will be rejected.

Octokit tries to mask this complexity from the user: accepting heads/foo and prepending refs/ instead of requiring refs/heads/foo be passed.

This misbehaved when refs/ appears anywhere else in ref, like heads/refs/is/slang/for/referees. I've added a failing tests case and updated the regexp to only match against the start of input to fix it.

@tarebyte tarebyte merged commit 9aa29ba into octokit:4-stable May 11, 2021
@thepwagner thepwagner deleted the create-spec-match-input-start branch May 11, 2021 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants