-
Bug
-
Resolution: Cannot Reproduce
-
Major
-
None
I ran the following commands to compare difference in time taken :
1. Non-shallow clone using pipeline DSL: checkout([$class: 'GitSCM', branches: [[name: branchName]], doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'LocalBranch', localBranch: branchName], [$class: 'CleanBeforeCheckout'], [$class: 'CloneOption', noTags: false, reference: '', shallow: false, timeout: 10]], submoduleCfg: [], userRemoteConfigs: [[url: 'git@github.corp.xxxx.com:'+orgName+'/'+repoName+'.git']]])
2. Shallow clone using pipeline DSL : checkout([$class: 'GitSCM', branches: [[name: branchName]], doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'LocalBranch', localBranch: branchName], [$class: 'CleanBeforeCheckout'], [$class: 'CloneOption', depth: 1, noTags: false, reference: '', shallow: true, timeout: 10]], submoduleCfg: [], userRemoteConfigs: [[url: 'git@github.corp.xxxx.com:'+orgName+'/'+repoName+'.git']]]) { note: I've also tried ^ shallow clone command without specifying 'depth: 1', but shows same behavior }
3. Shallow clone using shell command : sh "git clone --depth 1 git@github.xxx.com:Test/repoxyz.git -b master"
RESULTS :
1. Non-shallow clone command : 1min 54s
2. Shallow clone pipeline dsl command : 3min 31s
3. Shallow clone using shell command : 15 secs
ENVIRONMENT :
Jenkins : version 2.32.3
git-plugin : Tested in both versions- 3.2.0 & 3.3.0