MCPcopy
hub / github.com/github/git-sizer / Clone

Method Clone

internal/testutils/repoutils.go:73–87  ·  view source on GitHub ↗

Clone creates a clone of `repo` at a temporary path constructued using `pattern`. The caller is responsible for removing it when done by calling `Remove()`.

(t *testing.T, pattern string)

Source from the content-addressed store, hash-verified

71// using `pattern`. The caller is responsible for removing it when
72// done by calling `Remove()`.
73func (repo *TestRepo) Clone(t *testing.T, pattern string) *TestRepo {
74 t.Helper()
75
76 path, err := ioutil.TempDir("", pattern)
77 require.NoError(t, err)
78
79 err = repo.GitCommand(
80 t, "clone", "--bare", "--mirror", repo.Path, path,
81 ).Run()
82 require.NoError(t, err)
83
84 return &TestRepo{
85 Path: path,
86 }
87}
88
89// Repository returns a `*git.Repository` for `repo`.
90func (repo *TestRepo) Repository(t *testing.T) *git.Repository {

Callers 2

TestRefSelectionsFunction · 0.95
TestRefgroupsFunction · 0.95

Calls 2

GitCommandMethod · 0.95
RunMethod · 0.80

Tested by 2

TestRefSelectionsFunction · 0.76
TestRefgroupsFunction · 0.76