MCPcopy Create free account
hub / github.com/go-git/go-git / TestRemove

Method TestRemove

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

Source from the content-addressed store, hash-verified

2091}
2092
2093func (s *WorktreeSuite) TestRemove(c *C) {
2094 fs := memfs.New()
2095 w := &Worktree{
2096 r: s.Repository,
2097 Filesystem: fs,
2098 }
2099
2100 err := w.Checkout(&CheckoutOptions{Force: true})
2101 c.Assert(err, IsNil)
2102
2103 hash, err := w.Remove("LICENSE")
2104 c.Assert(hash.String(), Equals, "c192bd6a24ea1ab01d78686e417c8bdc7c3d197f")
2105 c.Assert(err, IsNil)
2106
2107 status, err := w.Status()
2108 c.Assert(err, IsNil)
2109 c.Assert(status, HasLen, 1)
2110 c.Assert(status.File("LICENSE").Staging, Equals, Deleted)
2111}
2112
2113func (s *WorktreeSuite) TestRemoveNotExistentEntry(c *C) {
2114 fs := memfs.New()

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected