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

Function runGitTest

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

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

Calls

no outgoing calls

Tested by

no test coverage detected