From b30f035537344692002e26c73445fc4acfef27c7 Mon Sep 17 00:00:00 2001 From: Tobias Florek Date: Fri, 2 Oct 2020 11:03:05 +0200 Subject: [PATCH] update submodules with --init flag This updates `pkg/git`'s submodule updating to also `git submodule init` recursively. Before submodules were not cloned recursively. Fixes #3320 --- pkg/git/git.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/pkg/git/git.go b/pkg/git/git.go index 9d7dca7419d..83d4f33284d 100644 --- a/pkg/git/git.go +++ b/pkg/git/git.go @@ -192,10 +192,7 @@ func SubmoduleFetch(logger *zap.SugaredLogger, spec FetchSpec) error { return fmt.Errorf("failed to change directory with path %s; err: %w", spec.Path, err) } } - if _, err := run(logger, "", "submodule", "init"); err != nil { - return err - } - updateArgs := []string{"submodule", "update", "--recursive"} + updateArgs := []string{"submodule", "update", "--recursive", "--init"} if spec.Depth > 0 { updateArgs = append(updateArgs, fmt.Sprintf("--depth=%d", spec.Depth)) }