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