(t *testing.T)
| 11 | ) |
| 12 | |
| 13 | func 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 | |
| 39 | func TestCloneWithCallback(t *testing.T) { |
| 40 | t.Parallel() |
nothing calls this directly
no test coverage detected
searching dependent graphs…