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

Resolve usernames when the remote ends with a trailing slash #110

Merged
merged 4 commits into from
Jan 21, 2024

Conversation

AA-Turner
Copy link
Member

@AA-Turner AA-Turner commented Jan 20, 2024

Closes #109

@AA-Turner AA-Turner linked an issue Jan 20, 2024 that may be closed by this pull request
Copy link
Member

@ezio-melotti ezio-melotti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix LGTM, but I would add a test here:

@pytest.mark.parametrize(
"url",
[
b"[email protected]:mock_user/cpython.git",
b"[email protected]:mock_user/cpython",
b"ssh://[email protected]/mock_user/cpython.git",
b"ssh://[email protected]/mock_user/cpython",
b"https://github.com/mock_user/cpython.git",
b"https://github.com/mock_user/cpython",
],
)
def test_username(url, config):
branches = ["3.6"]
cp = CherryPicker(
"origin", "22a594a0047d7706537ff2ac676cdc0f1dcb329c", branches, config=config
)
with mock.patch("subprocess.check_output", return_value=url):
assert cp.username == "mock_user"

@AA-Turner AA-Turner merged commit d7c3264 into main Jan 21, 2024
41 checks passed
@AA-Turner AA-Turner deleted the username-resolution branch January 21, 2024 08:44
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.

Username detection fails with a trailing slash
3 participants