MCPcopy Create free account
hub / github.com/google/gapid / runWithStdin

Method runWithStdin

core/git/git.go:55–68  ·  view source on GitHub ↗
(ctx context.Context, stdin io.Reader, args ...interface{})

Source from the content-addressed store, hash-verified

53}
54
55func (g Git) runWithStdin(ctx context.Context, stdin io.Reader, args ...interface{}) (string, string, error) {
56 argstrs := make([]string, len(args))
57 for i := range args {
58 argstrs[i] = fmt.Sprint(args[i])
59 }
60 stdout := &bytes.Buffer{}
61 stderr := &bytes.Buffer{}
62 cmd := shell.Command("git", argstrs...).In(g.wd).Read(stdin).Capture(stdout, stderr)
63 err := cmd.Run(ctx)
64 if err != nil {
65 err = fmt.Errorf("%v\n%v", err, stderr.String())
66 }
67 return stdout.String(), stderr.String(), err
68}

Callers 2

CanApplyPatchMethod · 0.95
runMethod · 0.95

Calls 7

SprintMethod · 0.80
InMethod · 0.80
CaptureMethod · 0.65
ReadMethod · 0.65
CommandMethod · 0.65
RunMethod · 0.65
StringMethod · 0.65

Tested by

no test coverage detected