Skip to content

Commit d45f21c

Browse files
committed
Clone all submodules without groovy handlers
List and clone all submodules that are still unitialized after all the handlers have run. Signed-off-by: Bence Szépkúti <[email protected]>
1 parent 8fa7d95 commit d45f21c

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

vars/checkout_repo.groovy

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,16 @@ void checkout_repo(BranchInfo info) {
188188
error("Invalid repo: ${info.repo}")
189189
}
190190

191+
echo 'Clone all remaining submodules without dedicated handlers'
192+
sh '''
193+
# Only split unquoted expansions on newlines
194+
IFS='
195+
'
196+
for module in $(git submodule status --recursive | sed -n 's/^-[^ ]* //p'); do
197+
git -C "$module" submodule update --recursive --init --depth=1 .
198+
done
199+
'''
200+
191201
stash name: stashName, includes: '**/*', useDefaultExcludes: false
192202
info.stash = stashName
193203
needUnstash = false

0 commit comments

Comments
 (0)