diff --git a/lib/scm/gitrepo.class.php b/lib/scm/gitrepo.class.php index 6bf5f0646a..a598f49a2a 100644 --- a/lib/scm/gitrepo.class.php +++ b/lib/scm/gitrepo.class.php @@ -603,7 +603,8 @@ class GitRepo { $url = new stdclass(); $remote = execCmd(escapeCmd("$this->client remote -v"), 'array'); - $pregHttp = '/http(s)?:\/\/(www\.)?[a-zA-Z0-9][-a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-a-zA-Z0-9]{0,62})+(:\d+)*(\/\w+)*\.git/'; + if(strpos($remote[0], 'oauth2:')) $remote[0] = preg_replace('/oauth2.*@/', '', $remote[0]); + $pregHttp = '/http(s)?:\/\/(www\.)?[a-zA-Z0-9][-a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-a-zA-Z0-9]{0,62})+(:\d+)*(\/\w+)*(\.git)?/'; $pregSSH = '/ssh:\/\/git@[a-zA-Z0-9][-a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-a-zA-Z0-9]{0,62})+(:\d+)*(\/\w+)*\.git/'; if(preg_match($pregHttp, $remote[0], $matches)) $url->http = $matches[0]; diff --git a/module/repo/view/maintain.html.php b/module/repo/view/maintain.html.php index b8aee00e0f..2eb4888c64 100644 --- a/module/repo/view/maintain.html.php +++ b/module/repo/view/maintain.html.php @@ -13,7 +13,7 @@