forked from qt-creator/qt-creator
Git: Add support for github remotes
Github and gitlab uses a different syntax when cloning with ssh: git@github.com:qt-creator/qt-creator.git Support this pattern for remote validatation also. Change-Id: Ic67f2238b9cdd526e76715c86846542cdb73f503 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
committed by
André Hartmann
parent
96f982a016
commit
3177e53804
@@ -3378,7 +3378,7 @@ GitRemote::GitRemote(const QString &url)
|
||||
{
|
||||
static const QRegularExpression remotePattern(
|
||||
"^(?:(?<protocol>[^:]+)://)?(?:(?<user>[^@]+)@)?(?<host>[^:/]+)"
|
||||
"(?::(?<port>\\d+))?:?(?<path>/.*)$");
|
||||
"(?::(?<port>\\d+))?:?(?<path>.*)$");
|
||||
|
||||
if (url.isEmpty())
|
||||
return;
|
||||
|
@@ -1612,6 +1612,11 @@ void GitPlugin::testGitRemote_data()
|
||||
.host("codereview.qt-project.org")
|
||||
.port(29418)
|
||||
.path("/qt-creator/qt-creator.git");
|
||||
QTest::newRow("ssh-github")
|
||||
<< RemoteTest("git@github.com:qt-creator/qt-creator.git")
|
||||
.userName("git")
|
||||
.host("github.com")
|
||||
.path("qt-creator/qt-creator.git");
|
||||
QTest::newRow("local-file-protocol")
|
||||
<< RemoteTest("file:///tmp/myrepo.git")
|
||||
.protocol("file")
|
||||
|
Reference in New Issue
Block a user