MCPcopy
hub / github.com/go-git/go-git / TestPullAlreadyUptodate

Method TestPullAlreadyUptodate

worktree_test.go:287–307  ·  view source on GitHub ↗
(c *C)

Source from the content-addressed store, hash-verified

285}
286
287func (s *WorktreeSuite) TestPullAlreadyUptodate(c *C) {
288 path := fixtures.Basic().ByTag("worktree").One().Worktree().Root()
289
290 fs := memfs.New()
291 r, err := Clone(memory.NewStorage(), fs, &CloneOptions{
292 URL: filepath.Join(path, ".git"),
293 })
294
295 c.Assert(err, IsNil)
296
297 w, err := r.Worktree()
298 c.Assert(err, IsNil)
299 err = util.WriteFile(fs, "bar", []byte("bar"), 0755)
300 c.Assert(err, IsNil)
301 w.Add("bar")
302 _, err = w.Commit("bar", &CommitOptions{Author: defaultSignature()})
303 c.Assert(err, IsNil)
304
305 err = w.Pull(&PullOptions{})
306 c.Assert(err, Equals, NoErrAlreadyUpToDate)
307}
308
309func (s *WorktreeSuite) TestPullDepth(c *C) {
310 r, err := Clone(memory.NewStorage(), memfs.New(), &CloneOptions{

Callers

nothing calls this directly

Calls 9

NewStorageFunction · 0.92
CloneFunction · 0.85
defaultSignatureFunction · 0.85
RootMethod · 0.80
WorktreeMethod · 0.80
JoinMethod · 0.80
PullMethod · 0.80
CommitMethod · 0.65
AddMethod · 0.45

Tested by

no test coverage detected