| 2436 | } |
| 2437 | |
| 2438 | func (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 | |
| 2461 | func (s *WorktreeSuite) TestRemoveGlob(c *C) { |
| 2462 | fs := memfs.New() |