Skip to content

Commit 9f51ae0

Browse files
committed
Handle .git generally also for GitHub/GitLab
This fixes #153
1 parent 91e3c12 commit 9f51ae0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/java/org/commonwl/view/workflow/WorkflowFormValidator.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public GitDetails validateAndParse(WorkflowForm form, Errors e) {
9999

100100
// Github Dir URL
101101
m = githubDirPattern.matcher(form.getUrl());
102-
if (m.find()) {
102+
if (m.find() && ! m.group(2).endsWith(".git")) {
103103
String repoUrl = "https://github.com/" + m.group(1) + "/" + m.group(2) + ".git";
104104
if (branch == null) branch = m.group(3);
105105
if (path == null) path = m.group(4);
@@ -108,7 +108,7 @@ public GitDetails validateAndParse(WorkflowForm form, Errors e) {
108108

109109
// Gitlab Dir URL
110110
m = gitlabDirPattern.matcher(form.getUrl());
111-
if (m.find()) {
111+
if (m.find() && ! m.group(2).endsWith(".git")) {
112112
String repoUrl = "https://gitlab.com/" + m.group(1) + "/" + m.group(2) + ".git";
113113
if (branch == null) branch = m.group(3);
114114
if (path == null) path = m.group(4);

0 commit comments

Comments
 (0)