(c *C)
| 107 | } |
| 108 | |
| 109 | func (s *WorktreeSuite) TestPullNonFastForward(c *C) { |
| 110 | url := c.MkDir() |
| 111 | |
| 112 | path := fixtures.Basic().ByTag("worktree").One().Worktree().Root() |
| 113 | |
| 114 | server, err := PlainClone(url, false, &CloneOptions{ |
| 115 | URL: path, |
| 116 | }) |
| 117 | c.Assert(err, IsNil) |
| 118 | |
| 119 | dir := c.MkDir() |
| 120 | |
| 121 | r, err := PlainClone(dir, false, &CloneOptions{ |
| 122 | URL: url, |
| 123 | }) |
| 124 | c.Assert(err, IsNil) |
| 125 | |
| 126 | w, err := server.Worktree() |
| 127 | c.Assert(err, IsNil) |
| 128 | err = os.WriteFile(filepath.Join(url, "foo"), []byte("foo"), 0755) |
| 129 | c.Assert(err, IsNil) |
| 130 | w.Add("foo") |
| 131 | _, err = w.Commit("foo", &CommitOptions{Author: defaultSignature()}) |
| 132 | c.Assert(err, IsNil) |
| 133 | |
| 134 | w, err = r.Worktree() |
| 135 | c.Assert(err, IsNil) |
| 136 | err = os.WriteFile(filepath.Join(dir, "bar"), []byte("bar"), 0755) |
| 137 | c.Assert(err, IsNil) |
| 138 | w.Add("bar") |
| 139 | _, err = w.Commit("bar", &CommitOptions{Author: defaultSignature()}) |
| 140 | c.Assert(err, IsNil) |
| 141 | |
| 142 | err = w.Pull(&PullOptions{}) |
| 143 | c.Assert(err, Equals, ErrNonFastForwardUpdate) |
| 144 | } |
| 145 | |
| 146 | func (s *WorktreeSuite) TestPullUpdateReferencesIfNeeded(c *C) { |
| 147 | r, _ := Init(memory.NewStorage(), memfs.New()) |
nothing calls this directly
no test coverage detected