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

Function writeCommit

internal/diff/git_resolve_test.go:38–45  ·  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

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

Calls 1

runGitTestFunction · 0.85

Tested by

no test coverage detected