(c *C)
| 2563 | } |
| 2564 | |
| 2565 | func (s *WorktreeSuite) TestMoveToExistent(c *C) { |
| 2566 | fs := memfs.New() |
| 2567 | w := &Worktree{ |
| 2568 | r: s.Repository, |
| 2569 | Filesystem: fs, |
| 2570 | } |
| 2571 | |
| 2572 | err := w.Checkout(&CheckoutOptions{Force: true}) |
| 2573 | c.Assert(err, IsNil) |
| 2574 | |
| 2575 | hash, err := w.Move(".gitignore", "LICENSE") |
| 2576 | c.Assert(hash.IsZero(), Equals, true) |
| 2577 | c.Assert(err, Equals, ErrDestinationExists) |
| 2578 | } |
| 2579 | |
| 2580 | func (s *WorktreeSuite) TestClean(c *C) { |
| 2581 | fs := fixtures.ByTag("dirty").One().Worktree() |