| 2178 | } |
| 2179 | |
| 2180 | func (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 | |
| 2203 | func (s *WorktreeSuite) TestRemoveGlob(c *C) { |
| 2204 | fs := memfs.New() |