MCPcopy Create free account
hub / github.com/diillson/chatcli / newLocalGitRepo

Function newLocalGitRepo

operator/controllers/source_controller_test.go:278–286  ·  view source on GitHub ↗

newLocalGitRepo creates a repo with one commit on branch main and returns its path.

(t *testing.T)

Source from the content-addressed store, hash-verified

276// newLocalGitRepo creates a repo with one commit on branch main and
277// returns its path.
278func newLocalGitRepo(t *testing.T) string {
279 t.Helper()
280 dir := t.TempDir()
281 runGit(t, dir, "-c", "init.defaultBranch=main", "init")
282 writeTestFile(t, filepath.Join(dir, "main.go"), "package main\n")
283 runGit(t, dir, "add", ".")
284 runGit(t, dir, "commit", "-m", "feat: initial commit")
285 return dir
286}
287
288func newSourceRepo(url, branch string) *platformv1alpha1.SourceRepository {
289 return &platformv1alpha1.SourceRepository{

Callers 2

TestGetRecentCommitsFunction · 0.85
TestPullRepoFunction · 0.85

Calls 2

runGitFunction · 0.85
writeTestFileFunction · 0.70

Tested by

no test coverage detected