Files
kandev/apps/backend/internal/worktree/git_command.go
T
2026-08-03 11:04:34 +01:00

20 lines
678 B
Go

package worktree
import (
"context"
"os/exec"
"github.com/kandev/kandev/internal/common/subproc"
)
// newGitCommand enables Git's long-path handling for this process only. Git
// accepts the setting on every supported platform, so using the same command
// shape everywhere keeps all package-owned Git invocations on one safe path
// without mutating repository, global, or system configuration.
func newGitCommand(ctx context.Context, args ...string) *exec.Cmd {
commandArgs := make([]string, 0, len(args)+2)
commandArgs = append(commandArgs, "-c", "core.longpaths=true")
commandArgs = append(commandArgs, args...)
return subproc.NewGitCommand(ctx, commandArgs...)
}