Skip to content

sync(git): Fix issue with @ in chomp_protocol() #446

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

Merged
merged 2 commits into from
Oct 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ $ pip install --user --upgrade --pre libvcs

<!-- Maintainers, insert changes / features for the next release here -->

### Bug fixes

- Git Remote URLs: Fix bug that would cause git remotes with `@` to be chopped off after the
protocol (#446, fixes #431)

### Packaging

- Move pytest configuration to `pyproject.toml` (#441)
Expand Down
3 changes: 0 additions & 3 deletions src/libvcs/sync/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -605,9 +605,6 @@ def chomp_protocol(url: str) -> str:
if "+" in url:
url = url.split("+", 1)[1]
scheme, netloc, path, query, frag = urlparse.urlsplit(url)
rev = None
if "@" in path:
path, rev = path.rsplit("@", 1)
url = urlparse.urlunsplit((scheme, netloc, path, query, ""))
if url.startswith("ssh://[email protected]/"):
url = url.replace("ssh://", "git+ssh://")
Expand Down