After updating gitlab-runner the fetch fails with `fatal: Needed a single revision`
Summary
When running the CI using the "gitlab-runner" docker image I have the following error:
...
HEAD is now at ec7259c "some commit message"
Entering 'MySubmodule'
HEAD is now at dfa3377 "some commit message"
Entering 'MySubmodule_2'
Entering 'MySubmodule_3'
HEAD is now at a22e5a8 "some commit message"
Entering 'MySubmodule_4'
HEAD is now at 964c499 "some commit message"
fatal: Needed a single revision
Unable to find current revision in submodule path 'MySubmodule_2'
Cleaning up project directory and file based variables 00:00
ERROR: Job failed: exit code 1
Steps to reproduce
- Setup a Gitlab runner in docker using the procedure at https://docs.gitlab.com/runner/install/docker.html#option-1-use-local-system-volume-mounts-to-start-the-runner-container
- Create a git repository with some git submodules
- Add in the
.gitlab-ci.yml
:
...
variables:
GIT_SUBMODULE_STRATEGY: recursive
...
- Run the ci.
Actual behavior
- Using gitlab-runner version 15.1.0 : The repository is correctly fetched in the CI
- Using gitlab-runner version 15.8.2 : The CI fails to fetch the git submodule with the error posted above.
Expected behaviour
The fetch should work for 15.8.2 as for 15.1.0
Possible fixes
I know that I can fix it by using GIT_STRATEGY: clone
but the decrease in performance will be too big to be considered a valid solution.