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

Function runGitTest

internal/diff/git_test.go:16–23  ·  view source on GitHub ↗

runGitTest runs a git command in dir and fails the test on error.

(t *testing.T, dir string, args ...string)

Source from the content-addressed store, hash-verified

14
15// runGitTest runs a git command in dir and fails the test on error.
16func runGitTest(t *testing.T, dir string, args ...string) {
17 t.Helper()
18 cmd := exec.Command("git", args...)
19 cmd.Dir = dir
20 if out, err := cmd.CombinedOutput(); err != nil {
21 t.Fatalf("git %v failed: %v\n%s", args, err, out)
22 }
23}
24
25// writeGarbageExternalDiff writes a shell script that emits non-diff output and
26// returns its path. When git invokes it via GIT_EXTERNAL_DIFF / diff.external it

Calls

no outgoing calls

Tested by

no test coverage detected