MCPcopy Create free account
hub / github.com/go-git/go-git / TestNotes

Method TestNotes

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

Source from the content-addressed store, hash-verified

2962}
2963
2964func (s *RepositorySuite) TestNotes(c *C) {
2965 // TODO add fixture with Notes
2966 url := s.GetLocalRepositoryURL(
2967 fixtures.ByURL("https://github.com/git-fixtures/tags.git").One(),
2968 )
2969
2970 r, _ := Init(memory.NewStorage(), nil)
2971 err := r.clone(context.Background(), &CloneOptions{URL: url})
2972 c.Assert(err, IsNil)
2973
2974 count := 0
2975 notes, err := r.Notes()
2976 c.Assert(err, IsNil)
2977
2978 notes.ForEach(func(note *plumbing.Reference) error {
2979 count++
2980 c.Assert(note.Hash().IsZero(), Equals, false)
2981 c.Assert(note.Name().IsNote(), Equals, true)
2982 return nil
2983 })
2984
2985 c.Assert(count, Equals, 0)
2986}
2987
2988func (s *RepositorySuite) TestTree(c *C) {
2989 r, _ := Init(memory.NewStorage(), nil)

Callers

nothing calls this directly

Calls 10

NewStorageFunction · 0.92
InitFunction · 0.85
GetLocalRepositoryURLMethod · 0.80
cloneMethod · 0.80
NotesMethod · 0.80
IsNoteMethod · 0.80
ForEachMethod · 0.65
IsZeroMethod · 0.65
HashMethod · 0.65
NameMethod · 0.65

Tested by

no test coverage detected