Output executes a git command and returns stdout only.
(ctx context.Context, repoDir string, args ...string)
| 58 | |
| 59 | // Output executes a git command and returns stdout only. |
| 60 | func (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. |
| 72 | func (r *Runner) RunSplit(ctx context.Context, repoDir string, args ...string) (string, string, error) { |