aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/object/commitnode_walker_ctime.go
diff options
context:
space:
mode:
authorFilip Navara <filip.navara@gmail.com>2019-04-24 11:13:53 +0200
committerFilip Navara <filip.navara@gmail.com>2019-04-24 11:16:46 +0200
commit9eb627fb7b86b2941fb96020f152cb5fd2df2bd3 (patch)
tree77899c4790d7af0c5765bcbad87a7b99849fa111 /plumbing/object/commitnode_walker_ctime.go
parentec65d90feaf3172a8bd1bf51bb85e7bdaaf28a54 (diff)
downloadgo-git-9eb627fb7b86b2941fb96020f152cb5fd2df2bd3.tar.gz
Simplify the CommitNode API, make it look more like Commit
Signed-off-by: Filip Navara <filip.navara@gmail.com>
Diffstat (limited to 'plumbing/object/commitnode_walker_ctime.go')
-rw-r--r--plumbing/object/commitnode_walker_ctime.go7
1 files changed, 2 insertions, 5 deletions
diff --git a/plumbing/object/commitnode_walker_ctime.go b/plumbing/object/commitnode_walker_ctime.go
index 86b6c57..e55b4ad 100644
--- a/plumbing/object/commitnode_walker_ctime.go
+++ b/plumbing/object/commitnode_walker_ctime.go
@@ -13,7 +13,6 @@ type commitNodeIteratorByCTime struct {
heap *binaryheap.Heap
seenExternal map[plumbing.Hash]bool
seen map[plumbing.Hash]bool
- nodeIndex CommitNodeIndex
}
// NewCommitNodeIterCTime returns a CommitNodeIter that walks the commit history,
@@ -26,7 +25,6 @@ type commitNodeIteratorByCTime struct {
// commits from being iterated.
func NewCommitNodeIterCTime(
c CommitNode,
- nodeIndex CommitNodeIndex,
seenExternal map[plumbing.Hash]bool,
ignore []plumbing.Hash,
) CommitNodeIter {
@@ -48,7 +46,6 @@ func NewCommitNodeIterCTime(
heap: heap,
seenExternal: seenExternal,
seen: seen,
- nodeIndex: nodeIndex,
}
}
@@ -68,11 +65,11 @@ func (w *commitNodeIteratorByCTime) Next() (CommitNode, error) {
w.seen[cID] = true
- for i, h := range w.nodeIndex.ParentHashes(c) {
+ for i, h := range c.ParentHashes() {
if w.seen[h] || w.seenExternal[h] {
continue
}
- pc, err := w.nodeIndex.ParentNode(c, i)
+ pc, err := c.ParentNode(i)
if err != nil {
return nil, err
}