Skip to content

Commit

Permalink
cargo: Handle trailing slash in GitHub URLs
Browse files Browse the repository at this point in the history
Signed-off-by: Michał Górny <mgorny@gentoo.org>
  • Loading branch information
mgorny committed Jul 4, 2024
1 parent eecdbc6 commit 0974def
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pycargoebuild/cargo.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ def get_crates(f: typing.BinaryIO) -> typing.Generator[Crate, None, None]:
raise RuntimeError(
"Git crate with no fragment identifier (i.e. commit "
f"identifier): {p['source']!r}")
repo = parsed_url.path.lstrip("/")
repo = parsed_url.path.strip("/")
if repo.endswith(".git"):
repo = repo[:-4]
if repo.count("/") != 1:
Expand Down
2 changes: 1 addition & 1 deletion test/test_cargo.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
[[package]]
name = "regex-syntax"
version = "0.6.28"
source = """git+https://github.com/01mf02/regex?rev=90eebbd\\
source = """git+https://github.com/01mf02/regex.git/?rev=90eebbd\\
#90eebbdb9396ca10510130327073a3d596674d04"""
'''

Expand Down

0 comments on commit 0974def

Please sign in to comment.