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

Method TestRemoveGlobDirectory

worktree_test.go:2480–2501  ·  view source on GitHub ↗
(c *C)

Source from the content-addressed store, hash-verified

2478}
2479
2480func (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
2503func (s *WorktreeSuite) TestRemoveGlobDirectoryDeleted(c *C) {
2504 fs := memfs.New()

Callers

nothing calls this directly

Calls 5

CheckoutMethod · 0.95
RemoveGlobMethod · 0.95
StatusMethod · 0.95
StatMethod · 0.65
FileMethod · 0.45

Tested by

no test coverage detected