Print out items in sparse item list if the list is not empty

This commit is contained in:
Dan Hawkins 2019-05-13 22:11:54 +01:00
commit 4c4958db9b

View file

@ -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: [],
])