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 authored and tekton-robot committed Oct 26, 2020
1 parent 4e66984 commit 43e307f
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 43e307f

Please sign in to comment.