MCPcopy Create free account
hub / github.com/JordanCoin/codemap / makeRepoOnBranch

Function makeRepoOnBranch

cmd/hooks_base_ref_test.go:19–33  ·  view source on GitHub ↗
(t *testing.T, branch string)

Source from the content-addressed store, hash-verified

17}
18
19func makeRepoOnBranch(t *testing.T, branch string) string {
20 t.Helper()
21 root := t.TempDir()
22
23 runGitTestCmd(t, root, "init")
24
25 if err := os.WriteFile(filepath.Join(root, "main.go"), []byte("package main\n"), 0644); err != nil {
26 t.Fatal(err)
27 }
28 runGitTestCmd(t, root, "add", ".")
29 runGitTestCmd(t, root, "-c", "user.name=Test", "-c", "user.email=test@example.com", "commit", "-m", "init")
30 runGitTestCmd(t, root, "branch", "-M", branch)
31
32 return root
33}
34
35func TestResolveHandoffBaseRef(t *testing.T) {
36 if _, err := exec.LookPath("git"); err != nil {

Calls 1

runGitTestCmdFunction · 0.85

Tested by

no test coverage detected