MCPcopy Index your code
hub / github.com/google/git-appraise / runGitCommandWithIOAndEnv

Method runGitCommandWithIOAndEnv

repository/git.go:47–55  ·  view source on GitHub ↗

Run the given git command with the given I/O reader/writers and environment, returning an error if it fails.

(stdin io.Reader, stdout, stderr io.Writer, env []string, args ...string)

Source from the content-addressed store, hash-verified

45
46// Run the given git command with the given I/O reader/writers and environment, returning an error if it fails.
47func (repo *GitRepo) runGitCommandWithIOAndEnv(stdin io.Reader, stdout, stderr io.Writer, env []string, args ...string) error {
48 cmd := exec.Command("git", args...)
49 cmd.Dir = repo.Path
50 cmd.Stdin = stdin
51 cmd.Stdout = stdout
52 cmd.Stderr = stderr
53 cmd.Env = env
54 return cmd.Run()
55}
56
57// Run the given git command with the given I/O reader/writers, returning an error if it fails.
58func (repo *GitRepo) runGitCommandWithIO(stdin io.Reader, stdout, stderr io.Writer, args ...string) error {

Callers 2

runGitCommandWithIOMethod · 0.95
runGitCommandWithEnvMethod · 0.95

Calls 1

RunMethod · 0.80

Tested by

no test coverage detected