Skip to content

Commit b0ccf25

Browse files
fix deprecated git protocol url
1 parent 7fe9474 commit b0ccf25

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

src/main/java/jenkins/plugins/git/GitToolChooser.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,6 @@ private String addSuffix(@NonNull String canonicalURL) {
175175
}
176176

177177
/* Protocol patterns to extract hostname and path from typical repository URLs */
178-
private static Pattern gitProtocolPattern = Pattern.compile("^git://([^/]+)/(.+?)/*$");
179178
private static Pattern httpProtocolPattern = Pattern.compile("^https?://([^/]+)/(.+?)/*$");
180179
private static Pattern sshAltProtocolPattern = Pattern.compile("^[\\w]+@(.+):(.+?)/*$");
181180
private static Pattern sshProtocolPattern = Pattern.compile("^ssh://[\\w]+@([^/]+)/(.+?)/*$");
@@ -193,7 +192,7 @@ private String addSuffix(@NonNull String canonicalURL) {
193192
Pattern [] protocolPatterns = {
194193
sshAltProtocolPattern,
195194
sshProtocolPattern,
196-
gitProtocolPattern,
195+
httpProtocolPattern,
197196
};
198197

199198
String matcherReplacement = "https://$1/$2";
@@ -237,14 +236,12 @@ private boolean setSizeFromInternalCache(String repoURL) {
237236
}
238237

239238
Pattern [] protocolPatterns = {
240-
gitProtocolPattern,
241239
httpProtocolPattern,
242240
sshAltProtocolPattern,
243241
sshProtocolPattern,
244242
};
245243

246244
String[] matcherReplacements = {
247-
"git://$1/$2", // git protocol
248245
"git@$1:$2", // ssh protocol alternate URL
249246
"https://$1/$2", // https protocol
250247
"ssh://git@$1/$2", // ssh protocol

0 commit comments

Comments
 (0)