I am trying to build a Jenkins pipeline (with a Windows agent, if this could be relevant) for a project in C/C++. My jenkinsfile contains the following lines:
stage('Clone') {
steps {
[...]
checkout changelog: false, poll: false,
scm: [$class: 'GitSCM', branches: [[name: "$gitlabBranch"]],
doGenerateSubmoduleConfigurations: false,
extensions: [],
submoduleCfg: [],
userRemoteConfigs: [[credentialsId: 'gitlab-credentials', url: "$gitlabSourceRepoHttpUrl"]]]
[...]
And the logfile is:
[Pipeline] checkout (hide)
using credential gitlab-credentials
Fetching changes from the remote Git repository
skipping resolution of commit remotes/origin/master, since it originates from another repository
Checking out Revision ccc3e1e628ffa2a4e98d847ea952f048724ffaf5 (refs/remotes/origin/master)
> git rev-parse --is-inside-work-tree # timeout=10
> git config remote.origin.url [URL REDACTED] # timeout=10
Fetching upstream changes from [URL REDACTED]
> git --version # timeout=10
using GIT_ASKPASS to set credentials gitlab-credentials (https-pipeline)
Setting http proxy: [REDACTED]
> git fetch --tags --progress -- [URL REDACTED] +refs/heads/*:refs/remotes/origin/* # timeout=10
> git rev-parse "refs/remotes/origin/master^{commit}" # timeout=10
> git rev-parse "refs/remotes/origin/origin/master^{commit}" # timeout=10
> git config core.sparsecheckout # timeout=10
> git checkout -f ccc3e1e628ffa2a4e98d847ea952f048724ffaf5 # timeout=10
Commit message: "Update Jenkinsfile"
> git rev-list --no-walk 628bc28a2c03a0f6f10ca1a75420c06efef16177 # timeout=10
The problem is, all data is fetched with timestamp set to the time of fetch, and therefore all files are compiled. What should I change?
I just checked, and I am sure that it is the checkout which retrieves everything: before that line, there are the old files, after that everything is updated.