MCPcopy Index your code
hub / github.com/go-git/go-git / TestStatsWithSubmodules

Method TestStatsWithSubmodules

plumbing/object/patch_test.go:18–47  ·  view source on GitHub ↗
(c *C)

Source from the content-addressed store, hash-verified

16var _ = Suite(&PatchSuite{})
17
18func (s *PatchSuite) TestStatsWithSubmodules(c *C) {
19 storer := filesystem.NewStorage(
20 fixtures.ByURL("https://github.com/git-fixtures/submodule.git").One().DotGit(), cache.NewObjectLRUDefault())
21
22 commit, err := GetCommit(storer, plumbing.NewHash("b685400c1f9316f350965a5993d350bc746b0bf4"))
23 c.Assert(err, IsNil)
24
25 tree, err := commit.Tree()
26 c.Assert(err, IsNil)
27
28 e, err := tree.entry("basic")
29 c.Assert(err, IsNil)
30
31 ch := &Change{
32 From: ChangeEntry{
33 Name: "basic",
34 Tree: tree,
35 TreeEntry: *e,
36 },
37 To: ChangeEntry{
38 Name: "basic",
39 Tree: tree,
40 TreeEntry: *e,
41 },
42 }
43
44 p, err := getPatch("", ch)
45 c.Assert(err, IsNil)
46 c.Assert(p, NotNil)
47}
48
49func (s *PatchSuite) TestFileStatsString(c *C) {
50 testCases := []struct {

Callers

nothing calls this directly

Calls 7

NewStorageFunction · 0.92
NewObjectLRUDefaultFunction · 0.92
NewHashFunction · 0.92
GetCommitFunction · 0.85
getPatchFunction · 0.85
TreeMethod · 0.65
entryMethod · 0.45

Tested by

no test coverage detected