:spakrles: add git submodules support
This commit is contained in:
parent
1bbe7d3a2c
commit
3f06a3ba4b
|
|
@ -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)
|
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 {
|
if *flChmod != 0 {
|
||||||
// set file permissions
|
// set file permissions
|
||||||
_, err = runCommand(ctx, "", "chmod", "-R", strconv.Itoa(*flChmod), worktreePath)
|
_, err = runCommand(ctx, "", "chmod", "-R", strconv.Itoa(*flChmod), worktreePath)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue