MCPcopy Create free account
hub / github.com/go-git/go-git / TestPullInSingleBranch

Method TestPullInSingleBranch

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

Source from the content-addressed store, hash-verified

173}
174
175func (s *WorktreeSuite) TestPullInSingleBranch(c *C) {
176 r, _ := Init(memory.NewStorage(), memfs.New())
177 err := r.clone(context.Background(), &CloneOptions{
178 URL: s.GetBasicLocalRepositoryURL(),
179 SingleBranch: true,
180 })
181
182 c.Assert(err, IsNil)
183
184 w, err := r.Worktree()
185 c.Assert(err, IsNil)
186
187 err = w.Pull(&PullOptions{})
188 c.Assert(err, Equals, NoErrAlreadyUpToDate)
189
190 branch, err := r.Reference("refs/heads/master", false)
191 c.Assert(err, IsNil)
192 c.Assert(branch.Hash().String(), Equals, "6ecf0ef2c2dffb796033e5a02219af86ec6584e5")
193
194 _, err = r.Reference("refs/remotes/foo/branch", false)
195 c.Assert(err, NotNil)
196
197 storage := r.Storer.(*memory.Storage)
198 c.Assert(storage.Objects, HasLen, 28)
199}
200
201func (s *WorktreeSuite) TestPullProgress(c *C) {
202 r, _ := Init(memory.NewStorage(), memfs.New())

Callers

nothing calls this directly

Calls 9

NewStorageFunction · 0.92
InitFunction · 0.85
cloneMethod · 0.80
WorktreeMethod · 0.80
PullMethod · 0.80
ReferenceMethod · 0.65
StringMethod · 0.65
HashMethod · 0.65

Tested by

no test coverage detected