MCPcopy Create free account
hub / github.com/alibaba/open-code-review / Output

Method Output

internal/gitcmd/runner.go:57–66  ·  view source on GitHub ↗

Output executes a git command and returns stdout only.

(ctx context.Context, repoDir string, args ...string)

Source from the content-addressed store, hash-verified

55
56// Output executes a git command and returns stdout only.
57func (r *Runner) Output(ctx context.Context, repoDir string, args ...string) ([]byte, error) {
58 if err := r.acquire(ctx); err != nil {
59 return nil, err
60 }
61 defer r.release()
62
63 cmd := exec.CommandContext(ctx, "git", args...)
64 cmd.Dir = repoDir
65 return cmd.Output()
66}
67
68// RunSplit executes a git command and returns stdout and stderr separately.
69func (r *Runner) RunSplit(ctx context.Context, repoDir string, args ...string) (string, string, error) {

Callers 9

finalizeDiffFunction · 0.80
TestRunner_OutputFunction · 0.80
gitLsMethod · 0.80
detectGitBranchFunction · 0.80
getHeadCommitFunction · 0.80
readFromGitShowMethod · 0.80
listGitFilesMethod · 0.80
runGitCmdStdoutFunction · 0.80

Calls 2

acquireMethod · 0.95
releaseMethod · 0.95

Tested by 3

TestRunner_OutputFunction · 0.64
getHeadCommitFunction · 0.64