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

Function writeCommit

internal/diff/git_resolve_test.go:41–48  ·  view source on GitHub ↗

writeCommit writes content to name, stages it, and commits with msg.

(t *testing.T, repo, name, content, msg string)

Source from the content-addressed store, hash-verified

39
40// writeCommit writes content to name, stages it, and commits with msg.
41func writeCommit(t *testing.T, repo, name, content, msg string) {
42 t.Helper()
43 if err := os.WriteFile(filepath.Join(repo, name), []byte(content), 0o644); err != nil {
44 t.Fatalf("write %s: %v", name, err)
45 }
46 runGitTest(t, repo, "add", name)
47 runGitTest(t, repo, "commit", "-q", "-m", msg)
48}
49
50func TestResolveInput_Range(t *testing.T) {
51 repo := initBareRepo(t)

Calls 1

runGitTestFunction · 0.85

Tested by

no test coverage detected