(t *testing.T)
| 11 | ) |
| 12 | |
| 13 | func 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. |
| 28 | func setupMirrorSourceRepo(t *testing.T) string { |
nothing calls this directly
no test coverage detected