aboutsummaryrefslogtreecommitdiffstats
path: root/commit.go
diff options
context:
space:
mode:
Diffstat (limited to 'commit.go')
-rw-r--r--commit.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/commit.go b/commit.go
index 1440403..afd67ab 100644
--- a/commit.go
+++ b/commit.go
@@ -45,6 +45,11 @@ func (c *Commit) Parents() *CommitIter {
return i
}
+// NumParents returns the number of parents in a commit.
+func (c *Commit) NumParents() int {
+ return len(c.parents)
+}
+
// Decode transform an core.Object into a Blob struct
func (c *Commit) Decode(o core.Object) error {
c.Hash = o.Hash()