Skip to content

Commit 3c2676d

Browse files
committed
fix(downloader): Determining the VCS type should not require availability
Determining the `VersionControlSystem` from `VcsType` or URL should work statically without any underlying external tool to be available at this point. If at all, the whole `VersionControlSystem` plugin should not load if a required external tool is not available. Signed-off-by: Sebastian Schuberth <[email protected]>
1 parent 5831169 commit 3c2676d

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

downloader/src/main/kotlin/VersionControlSystem.kt

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,7 @@ abstract class VersionControlSystem : Plugin {
5353
* Return the applicable VCS for the given [vcsType], or null if none is applicable.
5454
*/
5555
fun forType(vcsType: VcsType, configs: Map<String, PluginConfig> = emptyMap()) =
56-
getAllVcsByPriority(configs).find { vcs ->
57-
vcs.type == vcsType && vcs.isAvailable()
58-
}
56+
getAllVcsByPriority(configs).find { vcs -> vcs.type == vcsType }
5957

6058
/**
6159
* A map to cache the [VersionControlSystem], if any, for previously queried URLs and their respective plugin
@@ -78,9 +76,7 @@ abstract class VersionControlSystem : Plugin {
7876
when (val type = VcsHost.parseUrl(vcsUrl).type) {
7977
VcsType.UNKNOWN -> {
8078
// ...then eventually try to determine the type also dynamically.
81-
getAllVcsByPriority(configs).find { vcs ->
82-
vcs.isApplicableUrl(vcsUrl) && vcs.isAvailable()
83-
}
79+
getAllVcsByPriority(configs).find { vcs -> vcs.isApplicableUrl(vcsUrl) }
8480
}
8581

8682
else -> forType(type, configs)

0 commit comments

Comments
 (0)