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

Function TestMergeTreesWithoutAncestor

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

Source from the content-addressed store, hash-verified

100
101}
102func TestMergeTreesWithoutAncestor(t *testing.T) {
103 t.Parallel()
104 repo := createTestRepo(t)
105 defer cleanupTestRepo(t, repo)
106
107 _, originalTreeId := seedTestRepo(t, repo)
108 originalTree, err := repo.LookupTree(originalTreeId)
109
110 checkFatal(t, err)
111
112 _, newTreeId := updateReadme(t, repo, "file changed\n")
113
114 newTree, err := repo.LookupTree(newTreeId)
115 checkFatal(t, err)
116 index, err := repo.MergeTrees(nil, originalTree, newTree, nil)
117 if !index.HasConflicts() {
118 t.Fatal("expected conflicts in the index")
119 }
120 _, err = index.Conflict("README")
121 checkFatal(t, err)
122
123}
124
125func appendCommit(t *testing.T, repo *Repository) (*Oid, *Oid) {
126 loc, err := time.LoadLocation("Europe/Berlin")

Callers

nothing calls this directly

Calls 9

createTestRepoFunction · 0.85
cleanupTestRepoFunction · 0.85
seedTestRepoFunction · 0.85
checkFatalFunction · 0.85
updateReadmeFunction · 0.85
LookupTreeMethod · 0.80
MergeTreesMethod · 0.80
HasConflictsMethod · 0.80
ConflictMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…