8000 Resolve usernames when the remote ends with a trailing slash by AA-Turner · Pull Request #110 · python/cherry-picker · GitHub
[go: up one dir, main page]

Skip to content

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"git@github.com:mock_user/cpython.git",
b"git@github.com:mock_user/cpython",
b"ssh://git@github.com/mock_user/cpython.git",
b"ssh://git@github.com/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
@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

0