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

Method TestFetchWithProgress

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

Source from the content-addressed store, hash-verified

347}
348
349func (s *RemoteSuite) TestFetchWithProgress(c *C) {
350 url := s.GetBasicLocalRepositoryURL()
351 sto := memory.NewStorage()
352 buf := bytes.NewBuffer(nil)
353
354 r := NewRemote(sto, &config.RemoteConfig{Name: "foo", URLs: []string{url}})
355
356 refspec := config.RefSpec("+refs/heads/*:refs/remotes/origin/*")
357 err := r.Fetch(&FetchOptions{
358 RefSpecs: []config.RefSpec{refspec},
359 Progress: buf,
360 })
361
362 c.Assert(err, IsNil)
363 c.Assert(sto.Objects, HasLen, 31)
364
365 c.Assert(buf.Len(), Not(Equals), 0)
366}
367
368type mockPackfileWriter struct {
369 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