Skip to content

Commit c7bfe62

Browse files
authored
SRE-2077 ci: Add git remote prune to checkout. (#422)
Implementing a git remote prune as part of the git checkout process as defined in https://github.com/jenkinsci/git-plugin Signed-off-by: Phil Henderson <[email protected]>
1 parent 739e136 commit c7bfe62

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/com/intel/checkoutScmInternal.groovy

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,11 @@ def checkoutScmInternal(Map config = [:]) {
5858
extensions: [[$class: 'CloneOption', noTags: true, reference: '', shallow: false]],
5959
submoduleCfg: [],
6060
userRemoteConfigs: userRemoteConfigs]
61-
if (config['CleanAfterCheckout']) {
62-
params['extensions'].add([$class: 'CleanCheckout'])
61+
if (config['pruneStaleBranch']) {
62+
params['extensions'].add(pruneStaleBranch())
63+
}
64+
if (config['cleanAfterCheckout']) {
65+
params['extensions'].add([$class: 'cleanAfterCheckout'])
6366
}
6467

6568
if (config['checkoutDir']) {

vars/getFunctionalTestStage.groovy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,9 @@ Map call(Map kwargs = [:]) {
6666
url: 'https://github.com/daos-stack/daos.git',
6767
branch: base_branch,
6868
withSubmodules: true,
69-
cleanAfterCheckout: false)
69+
pruneStaleBranch: true)
7070
} else {
71-
checkoutScm(cleanAfterCheckout: false)
71+
checkoutScm(pruneStaleBranch: true)
7272
}
7373

7474
try {

0 commit comments

Comments
 (0)