This repository was archived by the owner on Sep 11, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +6
-3
lines changed Expand file tree Collapse file tree 3 files changed +6
-3
lines changed Original file line number Diff line number Diff line change 88 "gopkg.in/src-d/go-git.v4/plumbing/storer"
99)
1010
11- // CommitNode is generic interface encapsulating either Commit object or
12- // graphCommitNode object
11+ // CommitNode is generic interface encapsulating a lightweight commit object retrieved
12+ // from CommitNodeIndex
1313type CommitNode interface {
1414 // ID returns the Commit object id referenced by the commit graph node.
1515 ID () plumbing.Hash
@@ -30,7 +30,6 @@ type CommitNode interface {
3030}
3131
3232// CommitNodeIndex is generic interface encapsulating an index of CommitNode objects
33- // and accessor methods for walking it as a directed graph
3433type CommitNodeIndex interface {
3534 // Get returns a commit node from a commit hash
3635 Get (hash plumbing.Hash ) (CommitNode , error )
Original file line number Diff line number Diff line change @@ -33,6 +33,8 @@ type graphCommitNodeIndex struct {
3333 s storer.EncodedObjectStorer
3434}
3535
36+ // NewGraphCommitNodeIndex returns CommitNodeIndex implementation that uses commit-graph
37+ // files as backing storage and falls back to object storage when necessary
3638func NewGraphCommitNodeIndex (commitGraph commitgraph.Index , s storer.EncodedObjectStorer ) CommitNodeIndex {
3739 return & graphCommitNodeIndex {commitGraph , s }
3840}
Original file line number Diff line number Diff line change @@ -15,6 +15,8 @@ type objectCommitNode struct {
1515 commit * Commit
1616}
1717
18+ // NewObjectCommitNodeIndex returns CommitNodeIndex implementation that uses
19+ // only object storage to load the nodes
1820func NewObjectCommitNodeIndex (s storer.EncodedObjectStorer ) CommitNodeIndex {
1921 return & objectCommitNodeIndex {s }
2022}
You can’t perform that action at this time.
0 commit comments