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

Method TestFetchWithDepth

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

Source from the content-addressed store, hash-verified

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