diff --git a/rewrite-core/src/main/java/org/openrewrite/scm/AzureDevOpsScm.java b/rewrite-core/src/main/java/org/openrewrite/scm/AzureDevOpsScm.java index 3c499fc0e3b..894f54b6350 100644 --- a/rewrite-core/src/main/java/org/openrewrite/scm/AzureDevOpsScm.java +++ b/rewrite-core/src/main/java/org/openrewrite/scm/AzureDevOpsScm.java @@ -41,6 +41,6 @@ public String cleanHostAndPath(String url) { @Override public CloneUrl parseCloneUrl(String cloneUrl) { CloneUrl parsed = Scm.super.parseCloneUrl(cloneUrl); - return new AzureDevopsCloneUrl(parsed.getOrigin(), parsed.getPath()); + return new AzureDevopsCloneUrl(cloneUrl, getOrigin(), parsed.getPath()); } } diff --git a/rewrite-core/src/main/java/org/openrewrite/scm/AzureDevopsCloneUrl.java b/rewrite-core/src/main/java/org/openrewrite/scm/AzureDevopsCloneUrl.java index d2672cb54d5..91b4fd114e1 100644 --- a/rewrite-core/src/main/java/org/openrewrite/scm/AzureDevopsCloneUrl.java +++ b/rewrite-core/src/main/java/org/openrewrite/scm/AzureDevopsCloneUrl.java @@ -4,6 +4,7 @@ @Value public class AzureDevopsCloneUrl implements CloneUrl { + String cloneUrl; String origin; String path; diff --git a/rewrite-core/src/main/java/org/openrewrite/scm/CloneUrl.java b/rewrite-core/src/main/java/org/openrewrite/scm/CloneUrl.java index d8b8a75efe6..a113954f04b 100644 --- a/rewrite-core/src/main/java/org/openrewrite/scm/CloneUrl.java +++ b/rewrite-core/src/main/java/org/openrewrite/scm/CloneUrl.java @@ -19,6 +19,8 @@ public interface CloneUrl { + String getCloneUrl(); + String getOrigin(); String getPath(); diff --git a/rewrite-core/src/main/java/org/openrewrite/scm/GitLabCloneUrl.java b/rewrite-core/src/main/java/org/openrewrite/scm/GitLabCloneUrl.java index 1e34e4cb09d..07d3a7d3979 100644 --- a/rewrite-core/src/main/java/org/openrewrite/scm/GitLabCloneUrl.java +++ b/rewrite-core/src/main/java/org/openrewrite/scm/GitLabCloneUrl.java @@ -19,6 +19,7 @@ @Value public class GitLabCloneUrl implements CloneUrl { + String cloneUrl; String origin; String path; diff --git a/rewrite-core/src/main/java/org/openrewrite/scm/GitLabScm.java b/rewrite-core/src/main/java/org/openrewrite/scm/GitLabScm.java index 5f6f27f56db..8ada9e2df00 100644 --- a/rewrite-core/src/main/java/org/openrewrite/scm/GitLabScm.java +++ b/rewrite-core/src/main/java/org/openrewrite/scm/GitLabScm.java @@ -52,6 +52,6 @@ public String cleanHostAndPath(String url) { @Override public CloneUrl parseCloneUrl(String cloneUrl) { CloneUrl parsed = Scm.super.parseCloneUrl(cloneUrl); - return new GitLabCloneUrl(parsed.getOrigin(), parsed.getPath()); + return new GitLabCloneUrl(cloneUrl, getOrigin(), parsed.getPath()); } } diff --git a/rewrite-core/src/main/java/org/openrewrite/scm/Scm.java b/rewrite-core/src/main/java/org/openrewrite/scm/Scm.java index 550b0a90b4f..6d916075da4 100644 --- a/rewrite-core/src/main/java/org/openrewrite/scm/Scm.java +++ b/rewrite-core/src/main/java/org/openrewrite/scm/Scm.java @@ -30,10 +30,10 @@ default boolean belongsToScm(String cloneUrl) { default CloneUrl parseCloneUrl(String cloneUrl) { if (cloneUrl.length() < getOrigin().length() + 1) { - return new SimpleCloneUrl(getOrigin(), ""); + return new SimpleCloneUrl(cloneUrl, getOrigin(), ""); } String path = cleanHostAndPath(cloneUrl).substring(getOrigin().length() + 1); - return new SimpleCloneUrl(getOrigin(), path); + return new SimpleCloneUrl(cloneUrl, getOrigin(), path); } @Override diff --git a/rewrite-core/src/main/java/org/openrewrite/scm/SimpleCloneUrl.java b/rewrite-core/src/main/java/org/openrewrite/scm/SimpleCloneUrl.java index 03e6367e983..971c3a45cc0 100644 --- a/rewrite-core/src/main/java/org/openrewrite/scm/SimpleCloneUrl.java +++ b/rewrite-core/src/main/java/org/openrewrite/scm/SimpleCloneUrl.java @@ -19,6 +19,7 @@ @Value public class SimpleCloneUrl implements CloneUrl{ + String cloneUrl; String origin; String path; }