:spakrles: add git submodules support

This commit is contained in:
Michal Lula 2019-10-02 16:33:44 +02:00
parent 1bbe7d3a2c
commit 3f06a3ba4b
1 changed files with 8 additions and 0 deletions

View File

@ -452,6 +452,14 @@ func addWorktreeAndSwap(ctx context.Context, gitRoot, dest, branch, rev string,
}
log.V(0).Info("reset worktree to hash", "path", worktreePath, "hash", hash)
// Update submodules
_, err = runCommand(ctx, worktreePath, *flGitCmd, "submodule", "update", "--init", "--recursive")
if err != nil {
return err
}
log.V(0).Info("updating submodules")
if *flChmod != 0 {
// set file permissions
_, err = runCommand(ctx, "", "chmod", "-R", strconv.Itoa(*flChmod), worktreePath)