From 4c4958db9b40be65fa611df7a5feb3e820873483 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Mon, 13 May 2019 22:11:54 +0100 Subject: [PATCH] Print out items in sparse item list if the list is not empty --- versioncontrol/git.groovy | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/versioncontrol/git.groovy b/versioncontrol/git.groovy index fc15f81..56d206c 100644 --- a/versioncontrol/git.groovy +++ b/versioncontrol/git.groovy @@ -94,10 +94,11 @@ def gitCheckout(String gitURL, String revision, String targetDir, String repoRoo checkgitlfsinstall() def reporootpath = checkouttoreporoot(gitURL) if (!sparseitemlist.isEmpty()) { - echo "Items in sparse item list: " + def itemstring = "Items in sparse item list:\n" for (item in sparseitemlist) { - echo item + itemstring += item + "\n" } + echo itemstring } checkout([ $class: 'GitSCM', @@ -114,7 +115,7 @@ def gitCheckout(String gitURL, String revision, String targetDir, String repoRoo [$class: 'CloneOption', depth: cloneDepth, noTags: false, reference: reporootpath, shallow: shallowClone, timeout: 120], [$class: 'CheckoutOption', timeout: 120], [$class: 'RelativeTargetDirectory', relativeTargetDir: targetDir], - sparsecheckoutconfig(sparseitemlist) + [$class: 'SparseCheckoutPaths', sparseCheckoutPaths: sparsecheckoutconfig(sparseitemlist)], ], submoduleCfg: [], ])