Fixed cloning a package (library) from a private Git repository with custom user name and SSH port // Resolve #925

This commit is contained in:
Ivan Kravets
2017-06-24 15:45:48 +03:00
parent d8a0272bec
commit 1c5b08de59
3 changed files with 12 additions and 4 deletions

View File

@ -50,6 +50,9 @@ PlatformIO 3.0
* Fixed issue when `Library Dependency Finder (LDF) <http://docs.platformio.org/page/librarymanager/ldf.html>`__ * Fixed issue when `Library Dependency Finder (LDF) <http://docs.platformio.org/page/librarymanager/ldf.html>`__
does not handle custom ``src_dir`` does not handle custom ``src_dir``
(`issue #942 <https://github.com/platformio/platformio-core/issues/942>`_) (`issue #942 <https://github.com/platformio/platformio-core/issues/942>`_)
* Fixed cloning a package (library) from a private Git repository with
custom user name and SSH port
(`issue #925 <https://github.com/platformio/platformio-core/issues/925>`_)
------- -------

View File

@ -503,10 +503,10 @@ class BasePkgManager(PkgRepoMixin, PkgInstallerMixin):
url_marker = "://" url_marker = "://"
req_conditions = [ req_conditions = [
not requirements, "@" in text, not requirements,
(url_marker != "git@" and "://git@" not in text) or "@" in text,
text.count("@") > 1 not url_marker.startswith("git")
] ] # yapf: disable
if all(req_conditions): if all(req_conditions):
text, requirements = text.rsplit("@", 1) text, requirements = text.rsplit("@", 1)
if text.isdigit(): if text.isdigit():

View File

@ -127,6 +127,11 @@ def test_pkg_input_parser():
"git+ssh://git@gitlab.private-server.com/user/package#1.2.0", "git+ssh://git@gitlab.private-server.com/user/package#1.2.0",
("package", None, ("package", None,
"git+ssh://git@gitlab.private-server.com/user/package#1.2.0") "git+ssh://git@gitlab.private-server.com/user/package#1.2.0")
],
[
"git+ssh://user@gitlab.private-server.com:1234/package#1.2.0",
("package", None,
"git+ssh://user@gitlab.private-server.com:1234/package#1.2.0")
] ]
] ]
for params, result in items: for params, result in items: