(c *C)
| 2478 | } |
| 2479 | |
| 2480 | func (s *WorktreeSuite) TestRemoveGlobDirectory(c *C) { |
| 2481 | fs := memfs.New() |
| 2482 | w := &Worktree{ |
| 2483 | r: s.Repository, |
| 2484 | Filesystem: fs, |
| 2485 | } |
| 2486 | |
| 2487 | err := w.Checkout(&CheckoutOptions{Force: true}) |
| 2488 | c.Assert(err, IsNil) |
| 2489 | |
| 2490 | err = w.RemoveGlob("js*") |
| 2491 | c.Assert(err, IsNil) |
| 2492 | |
| 2493 | status, err := w.Status() |
| 2494 | c.Assert(err, IsNil) |
| 2495 | c.Assert(status, HasLen, 2) |
| 2496 | c.Assert(status.File("json/short.json").Staging, Equals, Deleted) |
| 2497 | c.Assert(status.File("json/long.json").Staging, Equals, Deleted) |
| 2498 | |
| 2499 | _, err = w.Filesystem.Stat("json") |
| 2500 | c.Assert(os.IsNotExist(err), Equals, true) |
| 2501 | } |
| 2502 | |
| 2503 | func (s *WorktreeSuite) TestRemoveGlobDirectoryDeleted(c *C) { |
| 2504 | fs := memfs.New() |
nothing calls this directly
no test coverage detected