diff --git a/news/112.bugfix.rst b/news/112.bugfix.rst new file mode 100644 index 00000000..09324efd --- /dev/null +++ b/news/112.bugfix.rst @@ -0,0 +1 @@ +Fixed a bug with parsing branch names which contain slashes. diff --git a/src/requirementslib/models/requirements.py b/src/requirementslib/models/requirements.py index d5330b48..d034a12d 100644 --- a/src/requirementslib/models/requirements.py +++ b/src/requirementslib/models/requirements.py @@ -891,8 +891,8 @@ def from_line(cls, line, editable=None, extras=None): name = link.egg_fragment subdirectory = link.subdirectory_fragment ref = None - if "@" in link.show_url and "@" in uri: - uri, ref = uri.rsplit("@", 1) + if "@" in link.path and "@" in uri: + uri, _, ref = uri.rpartition("@") if relpath and "@" in relpath: relpath, ref = relpath.rsplit("@", 1) return cls(