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

Method testFetch

remote_test.go:334–350  ·  view source on GitHub ↗
(c *C, r *Remote, o *FetchOptions, expected []*plumbing.Reference)

Source from the content-addressed store, hash-verified

332}
333
334func (s *RemoteSuite) testFetch(c *C, r *Remote, o *FetchOptions, expected []*plumbing.Reference) {
335 err := r.Fetch(o)
336 c.Assert(err, IsNil)
337
338 var refs int
339 l, err := r.s.IterReferences()
340 c.Assert(err, IsNil)
341 l.ForEach(func(r *plumbing.Reference) error { refs++; return nil })
342
343 c.Assert(refs, Equals, len(expected))
344
345 for _, exp := range expected {
346 r, err := r.s.Reference(exp.Name())
347 c.Assert(err, IsNil)
348 c.Assert(exp.String(), Equals, r.String())
349 }
350}
351
352func (s *RemoteSuite) TestFetchOfMissingObjects(c *C) {
353 tmp := c.MkDir()

Callers 12

TestFetchWildcardMethod · 0.95
TestFetchExactSHA1Method · 0.95
TestFetchWildcardTagsMethod · 0.95
TestFetchMethod · 0.95
TestFetchToNewBranchMethod · 0.95
TestFetchWithAllTagsMethod · 0.95
TestFetchWithNoTagsMethod · 0.95
TestFetchWithDepthMethod · 0.95
testFetchFastForwardMethod · 0.95

Calls 6

IterReferencesMethod · 0.65
ForEachMethod · 0.65
ReferenceMethod · 0.65
NameMethod · 0.65
StringMethod · 0.65
FetchMethod · 0.45

Tested by

no test coverage detected