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

Method NumParents

plumbing/object/commit.go:133–135  ·  view source on GitHub ↗

NumParents returns the number of parents in a commit.

()

Source from the content-addressed store, hash-verified

131
132// NumParents returns the number of parents in a commit.
133func (c *Commit) NumParents() int {
134 return len(c.ParentHashes)
135}
136
137var ErrParentNotFound = errors.New("commit parent not found")
138

Callers 2

NextMethod · 0.95
StatsContextMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected