Debugging northey

This commit is contained in:
Dan Hawkins 2021-06-30 17:41:19 +01:00
commit 149ece2304

View file

@ -12,7 +12,7 @@ def boolean isShallowClonedRepo(String gitrootpath) {
isshallowclone = sh(returnStdout: true, script: "git rev-parse --is-shallow-repository").trim().toBoolean() isshallowclone = sh(returnStdout: true, script: "git rev-parse --is-shallow-repository").trim().toBoolean()
} }
else { else {
isshallowclone = bat(returnStdout: true, script: "@git rev-parse --is-shallow-repository").trim().toBoolean() isshallowclone = powershell(returnStdout: true, script: "@git rev-parse --is-shallow-repository").trim().toBoolean()
} }
echo "Repo at ${gitrootpath} is shallow cloned: ${isshallowclone}" echo "Repo at ${gitrootpath} is shallow cloned: ${isshallowclone}"
} }
@ -89,9 +89,9 @@ def String checkouttoreporoot(String gitURL) {
if [ \$? -ne 0 ]; then exit 1; fi if [ \$? -ne 0 ]; then exit 1; fi
""" """
} else { } else {
bat """ powershell """
git status git status
if errorlevel 1 EXIT /b 1 if (\$lastexitcode -ge 1) { exit 1 }
""" """
} }
} }
@ -222,7 +222,7 @@ def gitinit(String targetDir, String reporootpath) {
git init "${targetDir}" git init "${targetDir}"
""" """
} else { } else {
bat """ powershell """
git init "${targetDir}" git init "${targetDir}"
""" """
} }
@ -246,7 +246,7 @@ def setlfsfetchinclude(String targetDir, ArrayList<String> sparseitemlist) {
git config lfs.fetchinclude "${sparseitemliststring}" git config lfs.fetchinclude "${sparseitemliststring}"
""" """
} else { } else {
bat """ powershell """
git config lfs.fetchinclude "${sparseitemliststring}" git config lfs.fetchinclude "${sparseitemliststring}"
""" """
} }
@ -264,7 +264,7 @@ def gitsparserestore(String targetDir) {
git reset --hard > /dev/null git reset --hard > /dev/null
""" """
} else { } else {
bat """ powershell """
git rm -rf . 2> nul git rm -rf . 2> nul
git clean -fxd 2> nul git clean -fxd 2> nul
git reset --hard 2> nul git reset --hard 2> nul
@ -312,7 +312,7 @@ def checkRepoExists(String gitURL) {
returnStatus: true returnStatus: true
) )
} else { } else {
result = bat( script: """ result = powershell( script: """
@git ls-remote "${gitURL}" CHECK_GIT_REMOTE_URL_REACHABILITY @git ls-remote "${gitURL}" CHECK_GIT_REMOTE_URL_REACHABILITY
""", """,
returnStatus: true returnStatus: true