MCPcopy Create free account
hub / github.com/libgit2/git2go / TestClone

Function TestClone

clone_test.go:13–37  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

11)
12
13func TestClone(t *testing.T) {
14 t.Parallel()
15 repo := createTestRepo(t)
16 defer cleanupTestRepo(t, repo)
17
18 seedTestRepo(t, repo)
19
20 path, err := ioutil.TempDir("", "git2go")
21 checkFatal(t, err)
22
23 ref, err := repo.References.Lookup("refs/heads/master")
24 checkFatal(t, err)
25
26 repo2, err := Clone(repo.Path(), path, &CloneOptions{Bare: true})
27 defer cleanupTestRepo(t, repo2)
28
29 checkFatal(t, err)
30
31 ref2, err := repo2.References.Lookup("refs/heads/master")
32 checkFatal(t, err)
33
34 if ref.Cmp(ref2) != 0 {
35 t.Fatal("reference in clone does not match original ref")
36 }
37}
38
39func TestCloneWithCallback(t *testing.T) {
40 t.Parallel()

Callers

nothing calls this directly

Calls 8

createTestRepoFunction · 0.85
cleanupTestRepoFunction · 0.85
seedTestRepoFunction · 0.85
checkFatalFunction · 0.85
CloneFunction · 0.85
LookupMethod · 0.45
PathMethod · 0.45
CmpMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…