(c *C)
| 247 | } |
| 248 | |
| 249 | func (s *FileSuite) TestFileIterSubmodule(c *C) { |
| 250 | dotgit := fixtures.ByURL("https://github.com/git-fixtures/submodule.git").One().DotGit() |
| 251 | st := filesystem.NewStorage(dotgit, cache.NewObjectLRUDefault()) |
| 252 | |
| 253 | hash := plumbing.NewHash("b685400c1f9316f350965a5993d350bc746b0bf4") |
| 254 | commit, err := GetCommit(st, hash) |
| 255 | c.Assert(err, IsNil) |
| 256 | |
| 257 | tree, err := commit.Tree() |
| 258 | c.Assert(err, IsNil) |
| 259 | |
| 260 | expected := []string{ |
| 261 | ".gitmodules", |
| 262 | "README.md", |
| 263 | } |
| 264 | |
| 265 | var count int |
| 266 | i := tree.Files() |
| 267 | i.ForEach(func(f *File) error { |
| 268 | c.Assert(f.Name, Equals, expected[count]) |
| 269 | count++ |
| 270 | return nil |
| 271 | }) |
| 272 | |
| 273 | c.Assert(count, Equals, 2) |
| 274 | } |
nothing calls this directly
no test coverage detected