Skip to content

Commit

Permalink
update submodules with --init flag
Browse files Browse the repository at this point in the history
This updates `pkg/git`'s submodule updating to also `git submodule init` recursively.
Before submodules were not cloned recursively.

Fixes #3320
  • Loading branch information
ibotty committed Oct 2, 2020
1 parent 8ecaa29 commit b30f035
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions pkg/git/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}
Expand Down

0 comments on commit b30f035

Please sign in to comment.