(c *C)
| 1421 | } |
| 1422 | |
| 1423 | func (s *WorktreeSuite) TestResetSparsely(c *C) { |
| 1424 | fs := memfs.New() |
| 1425 | w := &Worktree{ |
| 1426 | r: s.Repository, |
| 1427 | Filesystem: fs, |
| 1428 | } |
| 1429 | |
| 1430 | sparseResetDirs := []string{"php"} |
| 1431 | |
| 1432 | err := w.ResetSparsely(&ResetOptions{Mode: HardReset}, sparseResetDirs) |
| 1433 | c.Assert(err, IsNil) |
| 1434 | |
| 1435 | files, err := fs.ReadDir("/") |
| 1436 | c.Assert(err, IsNil) |
| 1437 | c.Assert(files, HasLen, 1) |
| 1438 | c.Assert(files[0].Name(), Equals, "php") |
| 1439 | |
| 1440 | files, err = fs.ReadDir("/php") |
| 1441 | c.Assert(err, IsNil) |
| 1442 | c.Assert(files, HasLen, 1) |
| 1443 | c.Assert(files[0].Name(), Equals, "crappy.php") |
| 1444 | } |
| 1445 | |
| 1446 | func (s *WorktreeSuite) TestStatusAfterCheckout(c *C) { |
| 1447 | fs := memfs.New() |
nothing calls this directly
no test coverage detected