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

Method TestPushWithProgress

repository_test.go:1675–1708  ·  view source on GitHub ↗
(c *C)

Source from the content-addressed store, hash-verified

1673}
1674
1675func (s *RepositorySuite) TestPushWithProgress(c *C) {
1676 fs := s.TemporalFilesystem(c)
1677
1678 path, err := util.TempDir(fs, "", "")
1679 c.Assert(err, IsNil)
1680
1681 url := fs.Join(fs.Root(), path)
1682
1683 server, err := PlainInit(url, true)
1684 c.Assert(err, IsNil)
1685
1686 m := "Receiving..."
1687 installPreReceiveHook(c, fs, path, m)
1688
1689 _, err = s.Repository.CreateRemote(&config.RemoteConfig{
1690 Name: "bar",
1691 URLs: []string{url},
1692 })
1693 c.Assert(err, IsNil)
1694
1695 var p bytes.Buffer
1696 err = s.Repository.Push(&PushOptions{
1697 RemoteName: "bar",
1698 Progress: &p,
1699 })
1700 c.Assert(err, IsNil)
1701
1702 AssertReferences(c, server, map[string]string{
1703 "refs/heads/master": "6ecf0ef2c2dffb796033e5a02219af86ec6584e5",
1704 "refs/heads/branch": "e8d3ffab552895c19b9fcf7aa264d277cde33881",
1705 })
1706
1707 c.Assert((&p).Bytes(), DeepEquals, []byte(m))
1708}
1709
1710func (s *RepositorySuite) TestPushDepth(c *C) {
1711 url := c.MkDir()

Callers

nothing calls this directly

Calls 9

PlainInitFunction · 0.85
installPreReceiveHookFunction · 0.85
AssertReferencesFunction · 0.85
JoinMethod · 0.80
RootMethod · 0.80
CreateRemoteMethod · 0.80
PushMethod · 0.65
TemporalFilesystemMethod · 0.45
BytesMethod · 0.45

Tested by

no test coverage detected