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

Method Output

internal/gitcmd/runner.go:60–69  ·  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

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

Callers 10

gitOutFunction · 0.80
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 4

gitOutFunction · 0.64
TestRunner_OutputFunction · 0.64
getHeadCommitFunction · 0.64