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

Function runGitTest

internal/diff/git_test.go:21–28  ·  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

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

Calls

no outgoing calls

Tested by

no test coverage detected