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

Method TestFetchWithDepth

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

Source from the content-addressed store, hash-verified

287}
288
289func (s *RemoteSuite) TestFetchWithDepth(c *C) {
290 r := NewRemote(memory.NewStorage(), &config.RemoteConfig{
291 URLs: []string{s.GetBasicLocalRepositoryURL()},
292 })
293
294 s.testFetch(c, r, &FetchOptions{
295 Depth: 1,
296 RefSpecs: []config.RefSpec{
297 config.RefSpec("+refs/heads/*:refs/remotes/origin/*"),
298 },
299 }, []*plumbing.Reference{
300 plumbing.NewReferenceFromStrings("refs/remotes/origin/master", "6ecf0ef2c2dffb796033e5a02219af86ec6584e5"),
301 plumbing.NewReferenceFromStrings("refs/remotes/origin/branch", "e8d3ffab552895c19b9fcf7aa264d277cde33881"),
302 plumbing.NewReferenceFromStrings("refs/tags/v1.0.0", "6ecf0ef2c2dffb796033e5a02219af86ec6584e5"),
303 })
304
305 c.Assert(r.s.(*memory.Storage).Objects, HasLen, 18)
306}
307
308func (s *RemoteSuite) TestFetchWithDepthChange(c *C) {
309 r := NewRemote(memory.NewStorage(), &config.RemoteConfig{

Callers

nothing calls this directly

Calls 6

testFetchMethod · 0.95
NewStorageFunction · 0.92
RefSpecTypeAlias · 0.92
NewReferenceFromStringsFunction · 0.92
NewRemoteFunction · 0.85

Tested by

no test coverage detected