From 7a9885309f0e620388491c37a1b05db273ccad28 Mon Sep 17 00:00:00 2001 From: caoyanyi Date: Mon, 1 Aug 2022 17:04:49 +0800 Subject: [PATCH 1/2] * Modify git clone url get. --- lib/scm/gitrepo.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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]; From 8d1632bdcc9f68f49500b3284fa4e3aa7ad01d5b Mon Sep 17 00:00:00 2001 From: caoyanyi Date: Mon, 1 Aug 2022 17:13:44 +0800 Subject: [PATCH 2/2] * Modify repo btn style. --- module/repo/view/maintain.html.php | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) 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 @@