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

Function TestMergeSameFile

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

Source from the content-addressed store, hash-verified

77}
78
79func TestMergeSameFile(t *testing.T) {
80 t.Parallel()
81 file := MergeFileInput{
82 Path: "test",
83 Mode: 33188,
84 Contents: []byte("hello world"),
85 }
86
87 result, err := MergeFile(file, file, file, nil)
88 checkFatal(t, err)
89 if !result.Automergeable {
90 t.Fatal("expected automergeable")
91 }
92 if result.Path != file.Path {
93 t.Fatal("path was incorrect")
94 }
95 if result.Mode != file.Mode {
96 t.Fatal("mode was incorrect")
97 }
98
99 compareBytes(t, file.Contents, result.Contents)
100
101}
102func TestMergeTreesWithoutAncestor(t *testing.T) {
103 t.Parallel()
104 repo := createTestRepo(t)

Callers

nothing calls this directly

Calls 3

MergeFileFunction · 0.85
checkFatalFunction · 0.85
compareBytesFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…