Could not access submodule when pulling recursively with git 2.21
After upgrading git my previously working projects with two or more submodules show the error
Could not access submodule 'foo' when executing
git pull --recurse-submodules=true.
Steps to reproduce
Create a project on gitlab.com with two or more git submodules. Change the paths in the file
.gitmodules to be relative according to https://docs.gitlab.com/ee/ci/git_submodules.html.
Clone the project and run
git submodule init, then run
git submodule update.
Then try to update recursively with different
$ git -v git version 2.20.1 $ git pull --recurse-submodules=true Fetching submodule 'foo' Fetching submodule 'bar' Already up to date. $ git -v git version 2.21.0 $ git pull --recurse-submodules=true Fetching submodule 'foo' Fetching submodule 'bar' Could not access submodule 'foo' Could not access submodule 'bar'
To note here is that I have a password protected ssh key that is unlocked.
Secondly I have a project that just has one submodule and there the error does not occur. The submodule in this project is shared by other projects with the issue and does exhibit the same error behaviour in those projects. In short I can reproduce this only in projects with 2 or more submodules.
I'm also not 100% sure if this is a gitlab related bug since its happening after the
git update. But I suspect that the relative submodules paths in
.gitmodules are to blame in combination with the updated
Other git operations in the main project work flawlessly, ie.
git submodule init,
git submodule update or changing into the submodule directory and running
git pull from there.
What is the current bug behavior?
Recursive pulling submodules doesn't work and breaks with
Could not access submodule.
What is the expected correct behavior?
Submodules should be pulled recursively.
Relevant logs and/or screenshots
$ uname -a Linux box 4.19.28-1-MANJARO #1 SMP PREEMPT Sun Mar 10 08:32:42 UTC 2019 x86_64 GNU/Linux
Output of checks
This bug happens on GitLab.com
git version 2.20.1