aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/object/commitgraph/commitnode_test.go
diff options
context:
space:
mode:
authorPaulo Gomes <pjbgf@linux.com>2023-10-08 12:12:05 +0100
committerGitHub <noreply@github.com>2023-10-08 12:12:05 +0100
commitb2df4aa7072e1e30abe3b97896dc437300b02845 (patch)
treeee2718e1ac621c88716068842e4ae38ed69862e8 /plumbing/object/commitgraph/commitnode_test.go
parent19fe126d8889134e6224717a756745eed9985e22 (diff)
parent946bb8183643bdda90810fc48e450a008894b244 (diff)
downloadgo-git-b2df4aa7072e1e30abe3b97896dc437300b02845.tar.gz
Merge pull request #854 from zeripath/graph-chain
plumbing: commitgraph, Allow reading commit-graph chains
Diffstat (limited to 'plumbing/object/commitgraph/commitnode_test.go')
-rw-r--r--plumbing/object/commitgraph/commitnode_test.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/plumbing/object/commitgraph/commitnode_test.go b/plumbing/object/commitgraph/commitnode_test.go
index 91fb211..441ff6f 100644
--- a/plumbing/object/commitgraph/commitnode_test.go
+++ b/plumbing/object/commitgraph/commitnode_test.go
@@ -6,7 +6,7 @@ import (
"github.com/go-git/go-git/v5/plumbing"
"github.com/go-git/go-git/v5/plumbing/cache"
- "github.com/go-git/go-git/v5/plumbing/format/commitgraph"
+ commitgraph "github.com/go-git/go-git/v5/plumbing/format/commitgraph/v2"
"github.com/go-git/go-git/v5/plumbing/format/packfile"
"github.com/go-git/go-git/v5/storage/filesystem"
@@ -115,6 +115,7 @@ func (s *CommitNodeSuite) TestCommitGraph(c *C) {
defer reader.Close()
index, err := commitgraph.OpenFileIndex(reader)
c.Assert(err, IsNil)
+ defer index.Close()
nodeIndex := NewGraphCommitNodeIndex(index, storer)
testWalker(c, nodeIndex)
@@ -132,10 +133,14 @@ func (s *CommitNodeSuite) TestMixedGraph(c *C) {
defer reader.Close()
fileIndex, err := commitgraph.OpenFileIndex(reader)
c.Assert(err, IsNil)
+ defer fileIndex.Close()
+
memoryIndex := commitgraph.NewMemoryIndex()
+ defer memoryIndex.Close()
+
for i, hash := range fileIndex.Hashes() {
if hash.String() != "b9d69064b190e7aedccf84731ca1d917871f8a1c" {
- node, err := fileIndex.GetCommitDataByIndex(i)
+ node, err := fileIndex.GetCommitDataByIndex(uint32(i))
c.Assert(err, IsNil)
memoryIndex.Add(hash, node)
}