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

Method TestAddReferenceHash

plumbing/protocol/packp/advrefs_test.go:30–39  ·  view source on GitHub ↗
(c *C)

Source from the content-addressed store, hash-verified

28}
29
30func (s *AdvRefSuite) TestAddReferenceHash(c *C) {
31 ref := plumbing.NewHashReference("foo", plumbing.NewHash("5dc01c595e6c6ec9ccda4f6f69c131c0dd945f8c"))
32
33 a := NewAdvRefs()
34 err := a.AddReference(ref)
35 c.Assert(err, IsNil)
36
37 c.Assert(a.References, HasLen, 1)
38 c.Assert(a.References["foo"].String(), Equals, "5dc01c595e6c6ec9ccda4f6f69c131c0dd945f8c")
39}
40
41func (s *AdvRefSuite) TestAllReferences(c *C) {
42 hash := plumbing.NewHash("5dc01c595e6c6ec9ccda4f6f69c131c0dd945f8c")

Callers

nothing calls this directly

Calls 5

AddReferenceMethod · 0.95
NewHashReferenceFunction · 0.92
NewHashFunction · 0.92
NewAdvRefsFunction · 0.85
StringMethod · 0.65

Tested by

no test coverage detected