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

Method TestUseRefDeltas

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

Source from the content-addressed store, hash-verified

1389}
1390
1391func (s *RemoteSuite) TestUseRefDeltas(c *C) {
1392 url := c.MkDir()
1393
1394 _, err := PlainInit(url, true)
1395 c.Assert(err, IsNil)
1396
1397 fs := fixtures.ByURL("https://github.com/git-fixtures/tags.git").One().DotGit()
1398 sto := filesystem.NewStorage(fs, cache.NewObjectLRUDefault())
1399
1400 r := NewRemote(sto, &config.RemoteConfig{
1401 Name: DefaultRemoteName,
1402 URLs: []string{url},
1403 })
1404
1405 ar := packp.NewAdvRefs()
1406
1407 ar.Capabilities.Add(capability.OFSDelta)
1408 c.Assert(r.useRefDeltas(ar), Equals, false)
1409
1410 ar.Capabilities.Delete(capability.OFSDelta)
1411 c.Assert(r.useRefDeltas(ar), Equals, true)
1412}
1413
1414func (s *RemoteSuite) TestPushRequireRemoteRefs(c *C) {
1415 f := fixtures.Basic().One()

Callers

nothing calls this directly

Calls 8

useRefDeltasMethod · 0.95
NewStorageFunction · 0.92
NewObjectLRUDefaultFunction · 0.92
NewAdvRefsFunction · 0.92
PlainInitFunction · 0.85
NewRemoteFunction · 0.85
DeleteMethod · 0.80
AddMethod · 0.45

Tested by

no test coverage detected