| 2091 | } |
| 2092 | |
| 2093 | func (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 | |
| 2113 | func (s *WorktreeSuite) TestRemoveNotExistentEntry(c *C) { |
| 2114 | fs := memfs.New() |