aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/object/commitnode_graph.go
diff options
context:
space:
mode:
Diffstat (limited to 'plumbing/object/commitnode_graph.go')
-rw-r--r--plumbing/object/commitnode_graph.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/plumbing/object/commitnode_graph.go b/plumbing/object/commitnode_graph.go
index b2a6f57..ac790ab 100644
--- a/plumbing/object/commitnode_graph.go
+++ b/plumbing/object/commitnode_graph.go
@@ -110,6 +110,13 @@ func (c *graphCommitNode) ParentHashes() []plumbing.Hash {
return c.commitData.ParentHashes
}
+func (c *graphCommitNode) Generation() uint64 {
+ // If the commit-graph file was generated with older Git version that
+ // set the generation to zero for every commit the generation assumption
+ // is still valid. It is just less useful.
+ return uint64(c.commitData.Generation)
+}
+
func (c *graphCommitNode) Commit() (*Commit, error) {
return GetCommit(c.gci.s, c.hash)
}