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

Function TestMergeBases

merge_test.go:176–194  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

174}
175
176func TestMergeBases(t *testing.T) {
177 t.Parallel()
178 repo := createTestRepo(t)
179 defer cleanupTestRepo(t, repo)
180
181 commitAId, _ := seedTestRepo(t, repo)
182 commitBId, _ := appendCommit(t, repo)
183
184 mergeBases, err := repo.MergeBases(commitAId, commitBId)
185 checkFatal(t, err)
186
187 if len(mergeBases) != 1 {
188 t.Fatalf("expected merge bases len to be 1, got %v", len(mergeBases))
189 }
190
191 if mergeBases[0].Cmp(commitAId) != 0 {
192 t.Fatalf("unexpected merge base")
193 }
194}
195
196func TestMergeBaseMany(t *testing.T) {
197 t.Parallel()

Callers

nothing calls this directly

Calls 7

createTestRepoFunction · 0.85
cleanupTestRepoFunction · 0.85
seedTestRepoFunction · 0.85
appendCommitFunction · 0.85
checkFatalFunction · 0.85
MergeBasesMethod · 0.80
CmpMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…