diff options
author | Filip Navara <filip.navara@gmail.com> | 2019-04-29 13:23:06 +0200 |
---|---|---|
committer | Filip Navara <filip.navara@gmail.com> | 2019-04-29 13:23:06 +0200 |
commit | 5f53b23103a04f97220f325772646b603c4dc25f (patch) | |
tree | bf25112c1a1ad5579ae1ea85d91e129b8138a2b4 /plumbing/object/commitnode_object.go | |
parent | a47126b1ae5020dbdd268b304fef45a59d63d99b (diff) | |
download | go-git-5f53b23103a04f97220f325772646b603c4dc25f.tar.gz |
Expose Generation property on CommitNode
Signed-off-by: Filip Navara <filip.navara@gmail.com>
Diffstat (limited to 'plumbing/object/commitnode_object.go')
-rw-r--r-- | plumbing/object/commitnode_object.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/plumbing/object/commitnode_object.go b/plumbing/object/commitnode_object.go index 52316f8..9ac42d2 100644 --- a/plumbing/object/commitnode_object.go +++ b/plumbing/object/commitnode_object.go @@ -1,6 +1,7 @@ package object
import (
+ "math"
"time"
"gopkg.in/src-d/go-git.v4/plumbing"
@@ -76,6 +77,13 @@ func (c *objectCommitNode) ParentHashes() []plumbing.Hash { return c.commit.ParentHashes
}
+func (c *objectCommitNode) Generation() uint64 {
+ // Commit nodes representing objects outside of the commit graph can never
+ // be reached by objects from the commit-graph thus we return the highest
+ // possible value.
+ return math.MaxUint64
+}
+
func (c *objectCommitNode) Commit() (*Commit, error) {
return c.commit, nil
}
|