diff --git a/versioncontrol/git.groovy b/versioncontrol/git.groovy index 5599dc6..253ffee 100644 --- a/versioncontrol/git.groovy +++ b/versioncontrol/git.groovy @@ -56,7 +56,20 @@ def String checkouttoreporoot(String gitURL) { submoduleCfg: [], ]) } else { - echo "Found ${gitURL} checked out at ${reporootsubfolder}" + echo "Found ${gitURL} checked out at ${reporootsubfolder} ... checking status" + dir(reporootsubfolder) { + if (isUnix()) { + sh """ + git status + if [ \$? -ne 0 ]; then exit 1; fi + """ + } else { + bat """ + git status + if errorlevel 1 EXIT /b 1 + """ + } + } } } return reporootsubfolder