| 1252 | } |
| 1253 | |
| 1254 | func (s *WorktreeSuite) TestResetMixed(c *C) { |
| 1255 | fs := memfs.New() |
| 1256 | w := &Worktree{ |
| 1257 | r: s.Repository, |
| 1258 | Filesystem: fs, |
| 1259 | } |
| 1260 | |
| 1261 | commit := plumbing.NewHash("35e85108805c84807bc66a02d91535e1e24b38b9") |
| 1262 | |
| 1263 | err := w.Checkout(&CheckoutOptions{}) |
| 1264 | c.Assert(err, IsNil) |
| 1265 | |
| 1266 | err = w.Reset(&ResetOptions{Mode: MixedReset, Commit: commit}) |
| 1267 | c.Assert(err, IsNil) |
| 1268 | |
| 1269 | branch, err := w.r.Reference(plumbing.Master, false) |
| 1270 | c.Assert(err, IsNil) |
| 1271 | c.Assert(branch.Hash(), Equals, commit) |
| 1272 | |
| 1273 | status, err := w.Status() |
| 1274 | c.Assert(err, IsNil) |
| 1275 | c.Assert(status.IsClean(), Equals, false) |
| 1276 | c.Assert(status.File("CHANGELOG").Staging, Equals, Untracked) |
| 1277 | } |
| 1278 | |
| 1279 | func (s *WorktreeSuite) TestResetMerge(c *C) { |
| 1280 | fs := memfs.New() |