-
-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ac364fa
commit c56b708
Showing
4 changed files
with
45 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,11 +16,7 @@ val GitRemote.httpUrl : URL? get() { | |
var url = firstUrl ?: return null | ||
|
||
url = url.trim() | ||
|
||
// Azure expects the .git postfix on the repo name unlike everything else | ||
if (!url.contains("dev.azure")) { | ||
url = url.removeSuffix(".git") | ||
} | ||
.removeSuffix(".git") | ||
|
||
// Do not try to remove the port if the URL uses the SSH protocol in the SCP syntax e.g. | ||
// '[email protected]:foo.git' as it does not support port definitions. Attempting to remove the port | ||
|
@@ -30,12 +26,6 @@ val GitRemote.httpUrl : URL? get() { | |
url = url.replace(":\\d{1,5}".toRegex(), "") // remove the port | ||
} | ||
|
||
// Hack for azure | ||
if (url.startsWith("[email protected]")) { | ||
url = url.replace("^git@ssh.".toRegex(), "git@") | ||
.replace(":v\\d{1,5}".toRegex(), "") // remove v3 from [email protected]:v3/ben-gibson/test/test | ||
} | ||
|
||
if (!url.startsWith("http")) { | ||
url = url | ||
.replace("git@", "") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,24 +44,7 @@ class RemoteTest { | |
Arguments.of( | ||
"xy://custom.gitlab.url/group/project.git", | ||
"http://custom.gitlab.url/group/project" | ||
), | ||
Arguments.of( | ||
"[email protected]:v3/ben-gibson/test/test", | ||
"http://dev.azure.com/ben-gibson/test/test" | ||
), | ||
Arguments.of( | ||
"http://[email protected]/ben-gibson/test/_git/test", | ||
"http://dev.azure.com/ben-gibson/test/_git/test" | ||
), | ||
// Azure does not strip .git like the others. | ||
Arguments.of( | ||
"[email protected]:v3/ben-gibson/test/test.git", | ||
"http://dev.azure.com/ben-gibson/test/test.git" | ||
), | ||
Arguments.of( | ||
"http://[email protected]/ben-gibson/test/_git/test.git", | ||
"http://dev.azure.com/ben-gibson/test/_git/test.git" | ||
), | ||
) | ||
) | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters