-
Bug
-
Resolution: Unresolved
-
Major
-
Jenkins 2.319.3
org.jenkins-ci.main:jenkins-war:2.319.3
org.jenkins-ci.plugins:git-client:3.11.0
org.jenkins-ci.plugins:git:4.10.3
git version 2.35
When specifying tag checkout behaviour explicitly in the git plugin, tags are only checked out if the workspace already exists and contains a git repository.
Reproduce by creating a git repository containing the following Jenkinsfile:
pipeline { agent any options { skipDefaultCheckout(true) } triggers { githubPush() } stages { stage('Clone repository') { steps { cleanWs() checkout([ $class: 'GitSCM', branches: scm.branches, doGenerateSubmoduleConfigurations: scm.doGenerateSubmoduleConfigurations, extensions: scm.extensions + [[$class: 'CloneOption', noTags: false, reference: '', shallow: false]], submoduleCfg: [], userRemoteConfigs: scm.userRemoteConfigs ]) checkout([ $class: 'GitSCM', branches: scm.branches, doGenerateSubmoduleConfigurations: scm.doGenerateSubmoduleConfigurations, extensions: scm.extensions + [[$class: 'CloneOption', noTags: false, reference: '', shallow: false]], submoduleCfg: [], userRemoteConfigs: scm.userRemoteConfigs ]) } } } }
and you will see this happens in the build log - I have attached the full build log for reference:
10:47:01 > /usr/bin/git fetch --no-tags --force --progress -- https://github.com/ilCatania/jenkins-git-no-tags.git +refs/heads/master:refs/remotes/origin/master # timeout=10 10:47:02 > /usr/bin/git fetch --tags --force --progress -- https://github.com/ilCatania/jenkins-git-no-tags.git +refs/heads/master:refs/remotes/origin/master # timeout=10
- relates to
-
JENKINS-45164 In jenkins pipeline a "checkout scm" now adds "--no-tags" instead of "--tags" for git projects
- Closed