Recursively set up Git submodules credentials

What does this MR do?

Previously if you used GIT_SUBMODULE_STRATEGY: normal and accessed nested submodules, !5962 (merged) only initialized the credentials for the top-level submodules. However, there are existing workflows that rely on git submodule update --init to just work from the nested directory.

To preserve existing workflows, recursively update the nested submodules credentials.

Why was this MR needed?

What's the best way to test this MR?

  1. Find/create a project with nested submodules.
  2. Set GIT_SUBMODULE_STRATEGY: normal in the .gitlab-ci.yml variables.
  3. Run a pipeline.
  4. Verify that running cd path/to/nested-submodule && git submodule update --init works.

What are the relevant issue numbers?

Relates to https://gitlab.com/gitlab-org/gitlab/-/issues/583366

Edited by Stan Hu

Merge request reports

Loading