From 34a79713cdf76c175386f954080896955f6981f4 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 2 Apr 2019 09:01:42 +0100 Subject: [PATCH] Check contents of reporoot repo --- versioncontrol/git.groovy | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) 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