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

Function initBareRepo

internal/diff/git_resolve_test.go:30–38  ·  view source on GitHub ↗

initBareRepo creates an empty (unborn) git repository with identity configured but no commits, returning the repo dir.

(t *testing.T)

Source from the content-addressed store, hash-verified

28// initBareRepo creates an empty (unborn) git repository with identity configured
29// but no commits, returning the repo dir.
30func initBareRepo(t *testing.T) string {
31 t.Helper()
32 repo := t.TempDir()
33 runGitTest(t, repo, "init", "-q")
34 runGitTest(t, repo, "config", "user.email", "test@example.com")
35 runGitTest(t, repo, "config", "user.name", "Test User")
36 runGitTest(t, repo, "config", "commit.gpgsign", "false")
37 return repo
38}
39
40// writeCommit writes content to name, stages it, and commits with msg.
41func writeCommit(t *testing.T, repo, name, content, msg string) {

Calls 1

runGitTestFunction · 0.85

Tested by

no test coverage detected