| 2349 | } |
| 2350 | |
| 2351 | func (s *WorktreeSuite) TestRemove(c *C) { |
| 2352 | fs := memfs.New() |
| 2353 | w := &Worktree{ |
| 2354 | r: s.Repository, |
| 2355 | Filesystem: fs, |
| 2356 | } |
| 2357 | |
| 2358 | err := w.Checkout(&CheckoutOptions{Force: true}) |
| 2359 | c.Assert(err, IsNil) |
| 2360 | |
| 2361 | hash, err := w.Remove("LICENSE") |
| 2362 | c.Assert(hash.String(), Equals, "c192bd6a24ea1ab01d78686e417c8bdc7c3d197f") |
| 2363 | c.Assert(err, IsNil) |
| 2364 | |
| 2365 | status, err := w.Status() |
| 2366 | c.Assert(err, IsNil) |
| 2367 | c.Assert(status, HasLen, 1) |
| 2368 | c.Assert(status.File("LICENSE").Staging, Equals, Deleted) |
| 2369 | } |
| 2370 | |
| 2371 | func (s *WorktreeSuite) TestRemoveNotExistentEntry(c *C) { |
| 2372 | fs := memfs.New() |