diff --git a/versioncontrol/git.groovy b/versioncontrol/git.groovy index 12d5bc6..ee7e99a 100644 --- a/versioncontrol/git.groovy +++ b/versioncontrol/git.groovy @@ -115,7 +115,7 @@ def gitCheckout(String gitURL, String revision, String targetDir, String repoRoo } def checkRepoExists(String gitURL) { - def boolean result = false + def int result = 0 if (isUnix()) { result = sh( script: """ git ls-remote "${gitURL}" CHECK_GIT_REMOTE_URL_REACHABILITY @@ -129,7 +129,7 @@ def checkRepoExists(String gitURL) { returnStatus: true ) } - if (!result) { + if (result > 0) { echo "git ls-remote return result: ${result}" error("The release repo: ${gitURL} cannot be found. Please ensure this exists before building") }