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

Method TestPlainCloneNoCheckout

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

Source from the content-addressed store, hash-verified

1217}
1218
1219func (s *RepositorySuite) TestPlainCloneNoCheckout(c *C) {
1220 dir := c.MkDir()
1221
1222 path := fixtures.ByTag("submodule").One().Worktree().Root()
1223 r, err := PlainClone(dir, false, &CloneOptions{
1224 URL: path,
1225 NoCheckout: true,
1226 RecurseSubmodules: DefaultSubmoduleRecursionDepth,
1227 })
1228 c.Assert(err, IsNil)
1229
1230 h, err := r.Head()
1231 c.Assert(err, IsNil)
1232 c.Assert(h.Hash().String(), Equals, "b685400c1f9316f350965a5993d350bc746b0bf4")
1233
1234 fi, err := osfs.New(dir).ReadDir("")
1235 c.Assert(err, IsNil)
1236 c.Assert(fi, HasLen, 1) // .git
1237}
1238
1239func (s *RepositorySuite) TestFetch(c *C) {
1240 r, _ := Init(memory.NewStorage(), nil)

Callers

nothing calls this directly

Calls 7

PlainCloneFunction · 0.85
RootMethod · 0.80
WorktreeMethod · 0.80
HeadMethod · 0.80
StringMethod · 0.65
HashMethod · 0.65
ReadDirMethod · 0.45

Tested by

no test coverage detected