Skip to content

Commit b4aaec0

Browse files
committed
chore(git): Use the more speaking lsRemoteRepository() function
This convenience function internally calls `LsRemoteCommand(null)`, but avoids the potentially confusing explicit use of `null`. Signed-off-by: Sebastian Schuberth <[email protected]>
1 parent 4137929 commit b4aaec0

File tree

1 file changed

+1
-2
lines changed
  • plugins/version-control-systems/git/src/main/kotlin

1 file changed

+1
-2
lines changed

plugins/version-control-systems/git/src/main/kotlin/Git.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ import java.security.PublicKey
2828
import org.apache.logging.log4j.kotlin.logger
2929

3030
import org.eclipse.jgit.api.Git as JGit
31-
import org.eclipse.jgit.api.LsRemoteCommand
3231
import org.eclipse.jgit.api.errors.GitAPIException
3332
import org.eclipse.jgit.errors.UnsupportedCredentialItem
3433
import org.eclipse.jgit.lib.Constants
@@ -150,7 +149,7 @@ class Git(
150149

151150
override fun isApplicableUrlInternal(vcsUrl: String): Boolean =
152151
runCatching {
153-
LsRemoteCommand(null).setRemote(vcsUrl).call().isNotEmpty()
152+
JGit.lsRemoteRepository().setRemote(vcsUrl).call().isNotEmpty()
154153
}.onFailure {
155154
logger.debug { "Failed to check whether $type is applicable for $vcsUrl: ${it.collectMessages()}" }
156155
}.isSuccess

0 commit comments

Comments
 (0)