| 734 | } |
| 735 | |
| 736 | func (s *WorktreeSuite) TestCheckoutBranch(c *C) { |
| 737 | w := &Worktree{ |
| 738 | r: s.Repository, |
| 739 | Filesystem: memfs.New(), |
| 740 | } |
| 741 | |
| 742 | err := w.Checkout(&CheckoutOptions{ |
| 743 | Branch: "refs/heads/branch", |
| 744 | }) |
| 745 | c.Assert(err, IsNil) |
| 746 | |
| 747 | head, err := w.r.Head() |
| 748 | c.Assert(err, IsNil) |
| 749 | c.Assert(head.Name().String(), Equals, "refs/heads/branch") |
| 750 | |
| 751 | status, err := w.Status() |
| 752 | c.Assert(err, IsNil) |
| 753 | c.Assert(status.IsClean(), Equals, true) |
| 754 | } |
| 755 | |
| 756 | func (s *WorktreeSuite) TestCheckoutCreateWithHash(c *C) { |
| 757 | w := &Worktree{ |