Skip to content

Commit

Permalink
commit
Browse files Browse the repository at this point in the history
  • Loading branch information
vinokurig committed Jul 24, 2023
1 parent c5963e0 commit b29339a
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ public class GitlabUrlParser {
private static final List<String> gitlabUrlPatternTemplates =
List.of(
"^(?<host>%s)/(?<subgroups>([^/]++/?)+)/-/tree/(?<branch>.++)(/)?",
"^(?<host>%s)/(?<subgroups>.*)"); // a wider one, should be the last in the
"^(?<host>%s)/(?<subgroups>.*)", // a wider one
"^git@(?<host>[^:]++):(?<subgroups>.*).git$");
// list
private final List<Pattern> gitlabUrlPatterns = new ArrayList<>();
private static final String OAUTH_PROVIDER_NAME = "gitlab";
Expand Down Expand Up @@ -163,6 +164,9 @@ public GitlabUrl parse(String url) {

private GitlabUrl parse(Matcher matcher) {
String host = matcher.group("host");
if (!host.startsWith("https://")) {
host = "https://" + host;
}
String subGroups = trimEnd(matcher.group("subgroups"), '/');
if (subGroups.endsWith(".git")) {
subGroups = subGroups.substring(0, subGroups.length() - 4);
Expand Down

0 comments on commit b29339a

Please sign in to comment.