Skip to content

Runner fails to check out submodules error: unknown switch `f'

Summary

Gitlab runner fails to check out repository with submodules using git 2.22, everything works ok on 2.21

Steps to reproduce

Have a repository with submodules and run CI. I have both relative(on the same gitlab instance) and absolute(on github) paths to the submodules, both fail.

Actual behavior

Running with gitlab-runner 11.11.0 (ac2a293c)
  on time_killer 8eb492aa
Using Shell executor...
Running on timekiller...
Reinitialized existing Git repository in /mnt/nvme/builds/8eb492aa/0/org/Project/.git/
Fetching changes...
From https://<gitlab_instance>/org/Project
   eadb014..792fc14  dev        -> origin/dev
Checking out 792fc142 as dev...
Removing Binaries/
Removing Build/
Removing Content/Collections/
Removing Content/Developers/
Removing DerivedDataCache/
Removing Intermediate/
Removing Saved/

Updating/initializing submodules recursively...
Synchronizing submodule url for 'Content/Assets'
Synchronizing submodule url for 'Plugins/ExtendedStandardLibrary'
Synchronizing submodule url for 'Plugins/VaRest'
Entering 'Content/Assets'
error: unknown switch `f'
usage: git submodule--helper foreach [--quiet] [--recursive] [--] <command>

    -q, --quiet           Suppress output of entering each submodule command
    --recursive           Recurse into nested submodules

fatal: run_command returned non-zero status while recursing in the nested submodules of Content/Assets
.
ERROR: Job failed: exit status 1

Expected behavior

The project checks out ok and the job runs

Running with gitlab-runner 11.11.0 (ac2a293c)
  on time_killer 8eb492aa
Using Shell executor...
Running on timekiller...
Reinitialized existing Git repository in /mnt/nvme/builds/8eb492aa/0/org/Project/.git/
Fetching changes...
Checking out 792fc142 as dev...

Updating/initializing submodules recursively...
Synchronizing submodule url for 'Content/Assets'
Synchronizing submodule url for 'Plugins/ExtendedStandardLibrary'
Synchronizing submodule url for 'Plugins/VaRest'
Entering 'Content/Assets'
Entering 'Plugins/ExtendedStandardLibrary'
Removing Binaries/
Removing Intermediate/
Entering 'Plugins/VaRest'
Removing Binaries/
Removing Intermediate/
Entering 'Content/Assets'
HEAD is now at 0f2b812 Add new aura icon
Entering 'Plugins/ExtendedStandardLibrary'
HEAD is now at bd07d88 Merge upstream
Entering 'Plugins/VaRest'
HEAD is now at c1961a6 clang-format update
Entering 'Content/Assets'
Entering 'Plugins/ExtendedStandardLibrary'
Entering 'Plugins/VaRest'
...

Environment description

The only difference between the two runs above is downgraded git package from 2.22 to 2.21

Used GitLab Runner version

# gitlab-runner --version
Version:      11.11.0
Git revision: ac2a293c
Git branch:   
GO version:   go1.12.5
Built:        2019-06-03T14:25:03+0000
OS/Arch:      linux/amd64

Installed 11.11.2, not sure why it shows as 11.11.0

Workaround

This is a breaking change form git 2.22. The current workaround is to rollback to Git 2.21

Edited by Steve Xuereb