TestCheckoutBisect simulates a git bisect going through the git history and checking every commit over the previous commit
(c *C, url string)
| 1023 | // TestCheckoutBisect simulates a git bisect going through the git history and |
| 1024 | // checking every commit over the previous commit |
| 1025 | func (s *WorktreeSuite) testCheckoutBisect(c *C, url string) { |
| 1026 | f := fixtures.ByURL(url).One() |
| 1027 | r := s.NewRepositoryWithEmptyWorktree(f) |
| 1028 | |
| 1029 | w, err := r.Worktree() |
| 1030 | c.Assert(err, IsNil) |
| 1031 | |
| 1032 | iter, err := w.r.Log(&LogOptions{}) |
| 1033 | c.Assert(err, IsNil) |
| 1034 | |
| 1035 | iter.ForEach(func(commit *object.Commit) error { |
| 1036 | err := w.Checkout(&CheckoutOptions{Hash: commit.Hash}) |
| 1037 | c.Assert(err, IsNil) |
| 1038 | |
| 1039 | status, err := w.Status() |
| 1040 | c.Assert(err, IsNil) |
| 1041 | c.Assert(status.IsClean(), Equals, true) |
| 1042 | |
| 1043 | return nil |
| 1044 | }) |
| 1045 | } |
| 1046 | |
| 1047 | func (s *WorktreeSuite) TestStatus(c *C) { |
| 1048 | fs := memfs.New() |