(c *C)
| 249 | } |
| 250 | |
| 251 | func (s *RepositorySuite) TestPullAdd(c *C) { |
| 252 | path := fixtures.Basic().ByTag("worktree").One().Worktree().Root() |
| 253 | |
| 254 | r, err := Clone(memory.NewStorage(), memfs.New(), &CloneOptions{ |
| 255 | URL: filepath.Join(path, ".git"), |
| 256 | }) |
| 257 | |
| 258 | c.Assert(err, IsNil) |
| 259 | |
| 260 | storage := r.Storer.(*memory.Storage) |
| 261 | c.Assert(storage.Objects, HasLen, 28) |
| 262 | |
| 263 | branch, err := r.Reference("refs/heads/master", false) |
| 264 | c.Assert(err, IsNil) |
| 265 | c.Assert(branch.Hash().String(), Equals, "6ecf0ef2c2dffb796033e5a02219af86ec6584e5") |
| 266 | |
| 267 | ExecuteOnPath(c, path, |
| 268 | "touch foo", |
| 269 | "git add foo", |
| 270 | "git commit --no-gpg-sign -m foo foo", |
| 271 | ) |
| 272 | |
| 273 | w, err := r.Worktree() |
| 274 | c.Assert(err, IsNil) |
| 275 | |
| 276 | err = w.Pull(&PullOptions{RemoteName: "origin"}) |
| 277 | c.Assert(err, IsNil) |
| 278 | |
| 279 | // the commit command has introduced a new commit, tree and blob |
| 280 | c.Assert(storage.Objects, HasLen, 31) |
| 281 | |
| 282 | branch, err = r.Reference("refs/heads/master", false) |
| 283 | c.Assert(err, IsNil) |
| 284 | c.Assert(branch.Hash().String(), Not(Equals), "6ecf0ef2c2dffb796033e5a02219af86ec6584e5") |
| 285 | } |
| 286 | |
| 287 | func (s *WorktreeSuite) TestPullAlreadyUptodate(c *C) { |
| 288 | path := fixtures.Basic().ByTag("worktree").One().Worktree().Root() |
nothing calls this directly
no test coverage detected