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