File tree Expand file tree Collapse file tree
configuration/steps/commands Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -59,6 +59,15 @@ def as_cmd_arg(self) -> list[str]:
5959 depth = "--depth " + str (self .depth )
6060 else :
6161 depth = ""
62+ # Some worker images (e.g. centos7) ship a git old enough (<1.8.4/2.8)
63+ # to not understand submodule update's --depth/--jobs flags at all --
64+ # it rejects the whole option set and dumps usage instead of erroring
65+ # on just the unknown flag. Fall back to a plain (non-shallow,
66+ # unparallelized) submodule update on those rather than failing.
67+ submodule_update = (
68+ f"git -c http.version=HTTP/1.1 submodule update --init --recursive { depth } --jobs={ self .jobs } "
69+ " || git -c http.version=HTTP/1.1 submodule update --init --recursive"
70+ )
6271 return [
6372 "bash" ,
6473 "-exc" ,
@@ -68,7 +77,7 @@ def as_cmd_arg(self) -> list[str]:
6877 f"git remote add origin { self .repo_url } && "
6978 f"git -c http.version=HTTP/1.1 fetch { depth } origin { self .commit } && "
7079 "git checkout FETCH_HEAD && "
71- f"git -c http.version=HTTP/1.1 submodule update --init --recursive { depth } --jobs= { self . jobs } "
80+ f"( { submodule_update } ) "
7281 )
7382 ),
7483 ]
You can’t perform that action at this time.
0 commit comments