Skip to content

ReferenceNames: Support non-UTF8 branch names#1239

Open
DanielEScherzer wants to merge 7 commits intorust-lang:masterfrom
DanielEScherzer:non-utf-branch
Open

ReferenceNames: Support non-UTF8 branch names#1239
DanielEScherzer wants to merge 7 commits intorust-lang:masterfrom
DanielEScherzer:non-utf-branch

Conversation

@DanielEScherzer
Copy link
Copy Markdown
Contributor

Rather than using Result::unwrap() on the result of str::from_utf8(), handle failures by converting the Utf8Error into a git2::Error; the iterator for reference names already returns Results that could be failures, so the signature is unchanged.

Add some end-to-end tests to confirm the results.

Fixes #1175

Rather than using `Result::unwrap()` on the result of `str::from_utf8()`,
handle failures by converting the `Utf8Error` into a `git2::Error`; the
iterator for reference names already returns `Result`s that could be failures,
so the signature is unchanged.

Add some end-to-end tests to confirm the results.

Fixes rust-lang#1175
@rustbot rustbot added the S-waiting-on-review Status: Waiting on review label Apr 22, 2026
@DanielEScherzer
Copy link
Copy Markdown
Contributor Author

DanielEScherzer commented Apr 22, 2026

Looks like git won't let you create such a branch on windows or macos (though on Windows I could run git branch -m $'\300', the resulting branch name had unicode replacement characters)

Anyway, if this looks good I'll rebase and squash it, we don't need all of these commits in the history

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Waiting on review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ReferenceNames panics if there is a non-UTF-8 reference

2 participants