From 43e307fe039389eaa66c2ead01883e1c1dba8a2d 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 0a2ec3a13ba..98f9020a0a6 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)) }