(c *C)
| 68 | } |
| 69 | |
| 70 | func (s *WorktreeSuite) TestPullFastForward(c *C) { |
| 71 | url, clean := s.TemporalDir() |
| 72 | defer clean() |
| 73 | |
| 74 | path := fixtures.Basic().ByTag("worktree").One().Worktree().Root() |
| 75 | |
| 76 | server, err := PlainClone(url, false, &CloneOptions{ |
| 77 | URL: path, |
| 78 | }) |
| 79 | c.Assert(err, IsNil) |
| 80 | |
| 81 | dir, clean := s.TemporalDir() |
| 82 | defer clean() |
| 83 | |
| 84 | r, err := PlainClone(dir, false, &CloneOptions{ |
| 85 | URL: url, |
| 86 | }) |
| 87 | c.Assert(err, IsNil) |
| 88 | |
| 89 | w, err := server.Worktree() |
| 90 | c.Assert(err, IsNil) |
| 91 | err = os.WriteFile(filepath.Join(path, "foo"), []byte("foo"), 0755) |
| 92 | c.Assert(err, IsNil) |
| 93 | hash, err := w.Commit("foo", &CommitOptions{Author: defaultSignature()}) |
| 94 | c.Assert(err, IsNil) |
| 95 | |
| 96 | w, err = r.Worktree() |
| 97 | c.Assert(err, IsNil) |
| 98 | |
| 99 | err = w.Pull(&PullOptions{}) |
| 100 | c.Assert(err, IsNil) |
| 101 | |
| 102 | head, err := r.Head() |
| 103 | c.Assert(err, IsNil) |
| 104 | c.Assert(head.Hash(), Equals, hash) |
| 105 | } |
| 106 | |
| 107 | func (s *WorktreeSuite) TestPullNonFastForward(c *C) { |
| 108 | url, clean := s.TemporalDir() |
nothing calls this directly
no test coverage detected