From d643cea1e8a6d618b2eddfdbed086c7bdf208658 Mon Sep 17 00:00:00 2001 From: Alberto Cortés Date: Mon, 16 Nov 2015 03:20:01 +0100 Subject: Blame support for files This also includes a diff package and revlist package (needed by blame) Some extra packfiles (<1MB) are also included, to be used as fixtures in the tests. --- commit.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'commit.go') 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() -- cgit