(c *C)
| 275 | } |
| 276 | |
| 277 | func (s *TreeSuite) TestTreeDiff(c *C) { |
| 278 | f := fixtures.ByURL("https://github.com/src-d/go-git.git").One() |
| 279 | storer := filesystem.NewStorage(f.DotGit(), cache.NewObjectLRUDefault()) |
| 280 | commit, err := GetCommit(storer, plumbing.NewHash("89f8bda31d29767a6d6ba8f9d0dfb941d598e843")) |
| 281 | c.Assert(err, IsNil) |
| 282 | |
| 283 | tree, err := commit.Tree() |
| 284 | c.Assert(err, IsNil) |
| 285 | |
| 286 | parentCommit, err := commit.Parent(0) |
| 287 | c.Assert(err, IsNil) |
| 288 | |
| 289 | parentTree, err := parentCommit.Tree() |
| 290 | c.Assert(err, IsNil) |
| 291 | |
| 292 | ch, err := parentTree.Diff(tree) |
| 293 | c.Assert(err, IsNil) |
| 294 | |
| 295 | c.Assert(ch, HasLen, 3) |
| 296 | c.Assert(ch[0].From.Name, Equals, "examples/object_storage/main.go") |
| 297 | c.Assert(ch[0].To.Name, Equals, "examples/storage/main.go") |
| 298 | |
| 299 | ch, err = parentTree.DiffContext(context.Background(), tree) |
| 300 | c.Assert(err, IsNil) |
| 301 | c.Assert(ch, HasLen, 3) |
| 302 | } |
| 303 | |
| 304 | func (s *TreeSuite) TestTreeIter(c *C) { |
| 305 | encIter, err := s.Storer.IterEncodedObjects(plumbing.TreeObject) |
nothing calls this directly
no test coverage detected