diff --git a/pycargoebuild/cargo.py b/pycargoebuild/cargo.py index 0c904c4..65a5006 100644 --- a/pycargoebuild/cargo.py +++ b/pycargoebuild/cargo.py @@ -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: diff --git a/test/test_cargo.py b/test/test_cargo.py index 0bff67a..88a58b6 100644 --- a/test/test_cargo.py +++ b/test/test_cargo.py @@ -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""" '''