SLING-9370 - Clean the working tree before starting a build
diff --git a/src/org/apache/sling/jenkins/SlingJenkinsHelper.groovy b/src/org/apache/sling/jenkins/SlingJenkinsHelper.groovy
index 956d639..70f0402 100644
--- a/src/org/apache/sling/jenkins/SlingJenkinsHelper.groovy
+++ b/src/org/apache/sling/jenkins/SlingJenkinsHelper.groovy
@@ -61,6 +61,7 @@
stage('Init') {
checkout scm
+ sh "git clean -fdx"
def url = sh(returnStdout: true, script: 'git config remote.origin.url').trim()
jobConfig.repoName = url.substring(url.lastIndexOf('/') + 1).replace('.git', '');
if ( fileExists('.sling-module.json') ) {
@@ -171,4 +172,4 @@
}
emailext subject: subject, body: body, replyTo: 'dev@sling.apache.org', recipientProviders: recipientProviders, to: jsonArrayToCsv(recipients)
-}
\ No newline at end of file
+}