MCPcopy Index your code
hub / github.com/go-git/go-git / TestRemoveDeletedFromWorktree

Method TestRemoveDeletedFromWorktree

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

Source from the content-addressed store, hash-verified

2436}
2437
2438func (s *WorktreeSuite) TestRemoveDeletedFromWorktree(c *C) {
2439 fs := memfs.New()
2440 w := &Worktree{
2441 r: s.Repository,
2442 Filesystem: fs,
2443 }
2444
2445 err := w.Checkout(&CheckoutOptions{Force: true})
2446 c.Assert(err, IsNil)
2447
2448 err = fs.Remove("LICENSE")
2449 c.Assert(err, IsNil)
2450
2451 hash, err := w.Remove("LICENSE")
2452 c.Assert(hash.String(), Equals, "c192bd6a24ea1ab01d78686e417c8bdc7c3d197f")
2453 c.Assert(err, IsNil)
2454
2455 status, err := w.Status()
2456 c.Assert(err, IsNil)
2457 c.Assert(status, HasLen, 1)
2458 c.Assert(status.File("LICENSE").Staging, Equals, Deleted)
2459}
2460
2461func (s *WorktreeSuite) TestRemoveGlob(c *C) {
2462 fs := memfs.New()

Callers

nothing calls this directly

Calls 6

CheckoutMethod · 0.95
RemoveMethod · 0.95
StatusMethod · 0.95
StringMethod · 0.65
RemoveMethod · 0.45
FileMethod · 0.45

Tested by

no test coverage detected