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

Method TestRemoveDeletedFromWorktree

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

Source from the content-addressed store, hash-verified

2178}
2179
2180func (s *WorktreeSuite) TestRemoveDeletedFromWorktree(c *C) {
2181 fs := memfs.New()
2182 w := &Worktree{
2183 r: s.Repository,
2184 Filesystem: fs,
2185 }
2186
2187 err := w.Checkout(&CheckoutOptions{Force: true})
2188 c.Assert(err, IsNil)
2189
2190 err = fs.Remove("LICENSE")
2191 c.Assert(err, IsNil)
2192
2193 hash, err := w.Remove("LICENSE")
2194 c.Assert(hash.String(), Equals, "c192bd6a24ea1ab01d78686e417c8bdc7c3d197f")
2195 c.Assert(err, IsNil)
2196
2197 status, err := w.Status()
2198 c.Assert(err, IsNil)
2199 c.Assert(status, HasLen, 1)
2200 c.Assert(status.File("LICENSE").Staging, Equals, Deleted)
2201}
2202
2203func (s *WorktreeSuite) TestRemoveGlob(c *C) {
2204 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