MCPcopy
hub / github.com/go-git/go-git / TestDiffChangeContent

Method TestDiffChangeContent

utils/merkletrie/filesystem/node_test.go:74–93  ·  view source on GitHub ↗
(c *C)

Source from the content-addressed store, hash-verified

72}
73
74func (s *NoderSuite) TestDiffChangeContent(c *C) {
75 fsA := memfs.New()
76 WriteFile(fsA, "foo", []byte("foo"), 0644)
77 WriteFile(fsA, "qux/bar", []byte("foo"), 0644)
78 WriteFile(fsA, "qux/qux", []byte("foo"), 0644)
79
80 fsB := memfs.New()
81 WriteFile(fsB, "foo", []byte("foo"), 0644)
82 WriteFile(fsB, "qux/bar", []byte("bar"), 0644)
83 WriteFile(fsB, "qux/qux", []byte("foo"), 0644)
84
85 ch, err := merkletrie.DiffTree(
86 NewRootNode(fsA, nil),
87 NewRootNode(fsB, nil),
88 IsEquals,
89 )
90
91 c.Assert(err, IsNil)
92 c.Assert(ch, HasLen, 1)
93}
94
95func (s *NoderSuite) TestDiffSymlinkDirOnA(c *C) {
96 fsA := memfs.New()

Callers

nothing calls this directly

Calls 3

DiffTreeFunction · 0.92
WriteFileFunction · 0.85
NewRootNodeFunction · 0.70

Tested by

no test coverage detected