1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2024-12-14 11:03:09 +02:00

Merge pull request #260 from marcusholl/pr/artifactSetVersionInsideWorktree

[refactoring] artifactSetVersion: use gitUtils#insideWorkTree
This commit is contained in:
Marcus Holl 2018-08-23 14:08:57 +02:00 committed by GitHub
commit 8c84bc67cd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -31,7 +31,7 @@ def call(Map parameters = [:], Closure body = null) {
def gitUtils = parameters.juStabGitUtils ?: new GitUtils()
if (fileExists('.git')) {
if (gitUtils.insideWorkTree()) {
if (sh(returnStatus: true, script: 'git diff --quiet HEAD') != 0)
error "[${STEP_NAME}] Files in the workspace have been changed previously - aborting ${STEP_NAME}"
}