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

Function TestUtil

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

Source from the content-addressed store, hash-verified

153}
154
155func TestUtil(t *testing.T) {
156 t.Parallel()
157 repo := createTestRepo(t)
158 defer cleanupTestRepo(t, repo)
159
160 commitId, _ := seedTestRepo(t, repo)
161
162 ref, err := repo.References.Create("refs/heads/foo", commitId, true, "")
163 checkFatal(t, err)
164
165 ref2, err := repo.References.Dwim("foo")
166 checkFatal(t, err)
167
168 if ref.Cmp(ref2) != 0 {
169 t.Fatalf("foo didn't dwim to the right thing")
170 }
171
172 if ref.Shorthand() != "foo" {
173 t.Fatalf("refs/heads/foo has no foo shorthand")
174 }
175
176 hasLog, err := repo.References.HasLog("refs/heads/foo")
177 checkFatal(t, err)
178 if !hasLog {
179 t.Fatalf("branches have logs by default")
180 }
181}
182
183func TestIsNote(t *testing.T) {
184 t.Parallel()

Callers

nothing calls this directly

Calls 9

createTestRepoFunction · 0.85
cleanupTestRepoFunction · 0.85
seedTestRepoFunction · 0.85
checkFatalFunction · 0.85
DwimMethod · 0.80
ShorthandMethod · 0.80
HasLogMethod · 0.80
CreateMethod · 0.45
CmpMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…