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

Method TestDiffTree

plumbing/object/difftree_test.go:106–349  ·  view source on GitHub ↗
(c *C)

Source from the content-addressed store, hash-verified

104}
105
106func (s *DiffTreeSuite) TestDiffTree(c *C) {
107 for i, t := range []struct {
108 repository string // the repo name as in localRepos
109 commit1 string // the commit of the first tree
110 commit2 string // the commit of the second tree
111 expected []expectChange // the expected list of []changeExpect
112 }{
113 {
114 "https://github.com/dezfowler/LiteMock.git",
115 "",
116 "",
117 []expectChange{},
118 },
119 {
120 "https://github.com/dezfowler/LiteMock.git",
121 "b7965eaa2c4f245d07191fe0bcfe86da032d672a",
122 "b7965eaa2c4f245d07191fe0bcfe86da032d672a",
123 []expectChange{},
124 },
125 {
126 "https://github.com/dezfowler/LiteMock.git",
127 "",
128 "b7965eaa2c4f245d07191fe0bcfe86da032d672a",
129 []expectChange{
130 {Action: merkletrie.Insert, Name: "README"},
131 },
132 },
133 {
134 "https://github.com/dezfowler/LiteMock.git",
135 "b7965eaa2c4f245d07191fe0bcfe86da032d672a",
136 "",
137 []expectChange{
138 {Action: merkletrie.Delete, Name: "README"},
139 },
140 },
141 {
142 "https://github.com/githubtraining/example-branches.git",
143 "",
144 "f0eb272cc8f77803478c6748103a1450aa1abd37",
145 []expectChange{
146 {Action: merkletrie.Insert, Name: "README.md"},
147 },
148 },
149 {
150 "https://github.com/githubtraining/example-branches.git",
151 "f0eb272cc8f77803478c6748103a1450aa1abd37",
152 "",
153 []expectChange{
154 {Action: merkletrie.Delete, Name: "README.md"},
155 },
156 },
157 {
158 "https://github.com/githubtraining/example-branches.git",
159 "f0eb272cc8f77803478c6748103a1450aa1abd37",
160 "f0eb272cc8f77803478c6748103a1450aa1abd37",
161 []expectChange{},
162 },
163 {

Callers

nothing calls this directly

Calls 8

storageFromPackfileMethod · 0.95
commitFromStorerMethod · 0.95
DiffMethod · 0.95
NewHashFunction · 0.92
equalChangesFunction · 0.85
assertChangesFunction · 0.85
DiffTreeFunction · 0.70
TreeMethod · 0.65

Tested by

no test coverage detected