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

Method TestPullInSingleBranch

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

Source from the content-addressed store, hash-verified

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