MCPcopy Index your code
hub / github.com/go-git/go-git / TestFetchWithProgress

Method TestFetchWithProgress

remote_test.go:383–400  ·  view source on GitHub ↗
(c *C)

Source from the content-addressed store, hash-verified

381}
382
383func (s *RemoteSuite) TestFetchWithProgress(c *C) {
384 url := s.GetBasicLocalRepositoryURL()
385 sto := memory.NewStorage()
386 buf := bytes.NewBuffer(nil)
387
388 r := NewRemote(sto, &config.RemoteConfig{Name: "foo", URLs: []string{url}})
389
390 refspec := config.RefSpec("+refs/heads/*:refs/remotes/origin/*")
391 err := r.Fetch(&FetchOptions{
392 RefSpecs: []config.RefSpec{refspec},
393 Progress: buf,
394 })
395
396 c.Assert(err, IsNil)
397 c.Assert(sto.Objects, HasLen, 31)
398
399 c.Assert(buf.Len(), Not(Equals), 0)
400}
401
402type mockPackfileWriter struct {
403 storage.Storer

Callers

nothing calls this directly

Calls 6

FetchMethod · 0.95
NewStorageFunction · 0.92
RefSpecTypeAlias · 0.92
NewRemoteFunction · 0.85
LenMethod · 0.45

Tested by

no test coverage detected