MCPcopy
hub / github.com/dagger/container-use / RunInteractiveGitCommand

Function RunInteractiveGitCommand

repository/git.go:56–68  ·  view source on GitHub ↗

RunInteractiveGitCommand executes a git command in the specified directory in interactive mode.

(ctx context.Context, dir string, w io.Writer, args ...string)

Source from the content-addressed store, hash-verified

54
55// RunInteractiveGitCommand executes a git command in the specified directory in interactive mode.
56func RunInteractiveGitCommand(ctx context.Context, dir string, w io.Writer, args ...string) (rerr error) {
57 slog.Info(fmt.Sprintf("[%s] $ git %s", dir, strings.Join(args, " ")))
58 defer func() {
59 slog.Info(fmt.Sprintf("[%s] $ git %s (DONE)", dir, strings.Join(args, " ")), "err", rerr)
60 }()
61
62 cmd := exec.CommandContext(ctx, "git", args...)
63 cmd.Dir = dir
64 cmd.Stdout = w
65 cmd.Stderr = w
66
67 return cmd.Run()
68}
69
70func getContainerUseRemote(ctx context.Context, repo string) (string, error) {
71 // Check if we already have a container-use remote

Callers 4

LogMethod · 0.85
DiffMethod · 0.85
MergeMethod · 0.85
ApplyMethod · 0.85

Calls 2

InfoMethod · 0.80
RunMethod · 0.80

Tested by

no test coverage detected