MCPcopy Create free account
hub / github.com/rilldata/rill / TestMirrorGitRepo

Function TestMirrorGitRepo

admin/server/github_test.go:13–25  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

11)
12
13func TestMirrorGitRepo(t *testing.T) {
14 src := setupMirrorSourceRepo(t)
15 dest := t.TempDir()
16
17 runGitCommand(t, dest, "init", "--bare")
18 err := mirrorGitRepo(context.Background(), src, dest, "", "")
19 require.NoError(t, err)
20
21 refs := runGitCommand(t, dest, "show-ref")
22 require.Contains(t, refs, "refs/heads/main")
23 require.Contains(t, refs, "refs/heads/feature")
24 require.Contains(t, refs, "refs/tags/v1.0")
25}
26
27// setupMirrorSourceRepo creates a local git repository with commits on two branches and a tag.
28func setupMirrorSourceRepo(t *testing.T) string {

Callers

nothing calls this directly

Calls 5

setupMirrorSourceRepoFunction · 0.85
runGitCommandFunction · 0.85
mirrorGitRepoFunction · 0.85
ContainsMethod · 0.80
TempDirMethod · 0.65

Tested by

no test coverage detected