Skip to content

Commit

Permalink
git: Don't call git submodule
Browse files Browse the repository at this point in the history
The reset function already calls `git switch --recurse-submodules` which handles setting up and checking out submodules. Calling `git submodule update` is redundant and leads to issues.

Signed-off-by: Reilly Brogan <[email protected]>
  • Loading branch information
ReillyBrogan committed Jun 13, 2024
1 parent c5da1d1 commit fc5f752
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions builder/source/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,18 +65,6 @@ func NewGit(uri, ref string) (*GitSource, error) {
return g, nil
}

// submodules will handle setup of the git submodules after a
// reset has taken place.
func (g *GitSource) submodules() error {
cmd := exec.Command("git", "submodule", "update", "--init", "--recursive")

cmd.Dir = g.ClonePath
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stdout

return cmd.Run()
}

// For some reason git blobless clones create pack files with 600 permissions. These break future operations
// as those files cannot be read by non-root users. Fix those permissions so things work as they should.
func (g *GitSource) fixPermissions() error {
Expand Down Expand Up @@ -147,12 +135,6 @@ func (g *GitSource) Fetch() error {
}
}

// Check out submodules
err := g.submodules()
if err != nil {
return err
}

return g.fixPermissions()
}

Expand Down

0 comments on commit fc5f752

Please sign in to comment.