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

Method TestPlainCloneShared

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

Source from the content-addressed store, hash-verified

938}
939
940func (s *RepositorySuite) TestPlainCloneShared(c *C) {
941 dir := c.MkDir()
942
943 remote := s.GetBasicLocalRepositoryURL()
944
945 r, err := PlainClone(dir, false, &CloneOptions{
946 URL: remote,
947 Shared: true,
948 })
949 c.Assert(err, IsNil)
950
951 altpath := path.Join(dir, GitDirName, "objects", "info", "alternates")
952 _, err = os.Stat(altpath)
953 c.Assert(err, IsNil)
954
955 data, err := os.ReadFile(altpath)
956 c.Assert(err, IsNil)
957
958 line := path.Join(remote, GitDirName, "objects") + "\n"
959 c.Assert(string(data), Equals, line)
960
961 cfg, err := r.Config()
962 c.Assert(err, IsNil)
963 c.Assert(cfg.Branches, HasLen, 1)
964 c.Assert(cfg.Branches["master"].Name, Equals, "master")
965}
966
967func (s *RepositorySuite) TestPlainCloneSharedHttpShouldReturnError(c *C) {
968 dir := c.MkDir()

Callers

nothing calls this directly

Calls 5

PlainCloneFunction · 0.85
JoinMethod · 0.80
StatMethod · 0.65
ConfigMethod · 0.65

Tested by

no test coverage detected