Do not substring `.git` while parsing Azure DevOps Urls

Signed-off-by: Igor Vinokur <ivinokur@redhat.com>
pull/541/head
Igor Vinokur 2023-08-10 15:04:15 +03:00
parent 0ea20e687b
commit c45cc43233
2 changed files with 10 additions and 7 deletions

View File

@ -71,10 +71,6 @@ public class AzureDevOpsURLParser {
}
String repoName = matcher.group("repoName");
if (repoName.endsWith(".git")) {
repoName = repoName.substring(0, repoName.length() - 4);
}
String project = matcher.group("project");
if (project == null) {
// if project is not specified, repo name must be equal to project name

View File

@ -71,7 +71,7 @@ public class AzureDevOpsURLParserTest {
"https://MyOrg@dev.azure.com/MyOrg/MyProject/_git/MyRepo.git",
"MyOrg",
"MyProject",
"MyRepo",
"MyRepo.git",
null,
null
},
@ -79,7 +79,7 @@ public class AzureDevOpsURLParserTest {
"https://MyOrg@dev.azure.com/MyOrg/MyProject/_git/MyRepo.dot.git",
"MyOrg",
"MyProject",
"MyRepo.dot",
"MyRepo.dot.git",
null,
null
},
@ -100,7 +100,14 @@ public class AzureDevOpsURLParserTest {
null
},
{"https://dev.azure.com/MyOrg/MyProject/_git/-", "MyOrg", "MyProject", "-", null, null},
{"https://dev.azure.com/MyOrg/MyProject/_git/-j.git", "MyOrg", "MyProject", "-j", null, null},
{
"https://dev.azure.com/MyOrg/MyProject/_git/-j.git",
"MyOrg",
"MyProject",
"-j.git",
null,
null
},
{
"https://MyOrg@dev.azure.com/MyOrg/MyProject/_git/MyRepo?path=MyFile&version=GBmain&_a=contents",
"MyOrg",