The source project of this merge request has been removed.
explicitly set submodule.recurse to false, to avoid checkout commands recursing into submodules
What does this MR do?
Fixes a bug which caused gitlab-runner with git config submodule.recurse true
to fail while checking out after fetching the changes of the remote repository into a clone already existing on the runner.
See #27825 for more details of the issue.
Why was this MR needed?
Because gitlab-runner should behave consistently when fetching changes to the repository, and we already have the
func (b *AbstractShell) writeSubmoduleUpdateCmds(w ShellWriter, info common.ShellScriptInfo)
for updating submodules if the GIT_SUBMODULE_STRATEGY
indicates updating is required.
What's the best way to test this MR?
- Set up a project with a submodule and pipeline definition.
- Set up a runner with
git config --global submodule.recurse true
- Trigger an initial pipeline so that the runner clones the repository
- Commit in the submodule, then update the main repository's reference to the submodule in another commit
- Pipeline will trigger due to step 4, this time succeeding to
git checkout -f -q <SHA-1>
, because the checkout no longer recurses into the submodule as well
What are the relevant issue numbers?
#27825
Edited by Ciprian Daniel Petrisor