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

Function TestReferenceOwner

reference_test.go:135–153  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

133}
134
135func TestReferenceOwner(t *testing.T) {
136 t.Parallel()
137 repo := createTestRepo(t)
138 defer cleanupTestRepo(t, repo)
139
140 commitId, _ := seedTestRepo(t, repo)
141
142 ref, err := repo.References.Create("refs/heads/foo", commitId, true, "")
143 checkFatal(t, err)
144
145 owner := ref.Owner()
146 if owner == nil {
147 t.Fatal("nil owner")
148 }
149
150 if owner.ptr != repo.ptr {
151 t.Fatalf("bad ptr, expected %v have %v\n", repo.ptr, owner.ptr)
152 }
153}
154
155func TestUtil(t *testing.T) {
156 t.Parallel()

Callers

nothing calls this directly

Calls 6

createTestRepoFunction · 0.85
cleanupTestRepoFunction · 0.85
seedTestRepoFunction · 0.85
checkFatalFunction · 0.85
CreateMethod · 0.45
OwnerMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…