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

This commit is contained in:
Dan Hawkins 2019-05-13 22:54:47 +01:00
commit ddc231ccac

View file

@ -11,12 +11,12 @@ String getGitInfo(String workingSetRootPath) {
}
@NonCPS
def SparseCheckoutPaths sparsecheckoutconfig(ArrayList<String> paths) {
def ArrayList<SparseCheckoutPath> sparsecheckoutconfig(ArrayList<String> paths) {
ArrayList<SparseCheckoutPath> sparsecheckoutpaths = new ArrayList<SparseCheckoutPath>()
for (path in paths) {
sparsecheckoutpaths.add(new SparseCheckoutPath(path))
}
return new SparseCheckoutPaths(sparsecheckoutpaths)
return sparsecheckoutpaths
}
def String uniquereporootname(String gitURL) {
@ -115,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],
[$class: 'SparseCheckoutPaths', sparsecheckoutconfig(sparseitemlist)],
[$class: 'SparseCheckoutPaths', sparseCheckoutPaths: sparsecheckoutconfig(sparseitemlist)],
],
submoduleCfg: [],
])