aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plumbing/format/commitgraph/commitgraph_test.go3
-rw-r--r--plumbing/format/commitgraph/file.go4
-rw-r--r--plumbing/format/commitgraph/memory.go3
3 files changed, 4 insertions, 6 deletions
diff --git a/plumbing/format/commitgraph/commitgraph_test.go b/plumbing/format/commitgraph/commitgraph_test.go
index b984142..837f32f 100644
--- a/plumbing/format/commitgraph/commitgraph_test.go
+++ b/plumbing/format/commitgraph/commitgraph_test.go
@@ -116,8 +116,7 @@ func (s *CommitgraphSuite) TestReencodeInMemory(c *C) {
for i, hash := range index.Hashes() {
node, err := index.GetNodeByIndex(i)
c.Assert(err, IsNil)
- err = memoryIndex.Add(hash, node)
- c.Assert(err, IsNil)
+ memoryIndex.Add(hash, node)
}
reader.Close()
diff --git a/plumbing/format/commitgraph/file.go b/plumbing/format/commitgraph/file.go
index dce6243..26dff39 100644
--- a/plumbing/format/commitgraph/file.go
+++ b/plumbing/format/commitgraph/file.go
@@ -14,11 +14,11 @@ import (
var (
// ErrUnsupportedVersion is returned by OpenFileIndex when the commit graph
// file version is not supported.
- ErrUnsupportedVersion = errors.New("Unsuported version")
+ ErrUnsupportedVersion = errors.New("Unsupported version")
// ErrUnsupportedHash is returned by OpenFileIndex when the commit graph
// hash function is not supported. Currently only SHA-1 is defined and
// supported
- ErrUnsupportedHash = errors.New("Unsuported hash algorithm")
+ ErrUnsupportedHash = errors.New("Unsupported hash algorithm")
// ErrMalformedCommitGraphFile is returned by OpenFileIndex when the commit
// graph file is corrupted.
ErrMalformedCommitGraphFile = errors.New("Malformed commit graph file")
diff --git a/plumbing/format/commitgraph/memory.go b/plumbing/format/commitgraph/memory.go
index 316bc6d..1d57a07 100644
--- a/plumbing/format/commitgraph/memory.go
+++ b/plumbing/format/commitgraph/memory.go
@@ -60,12 +60,11 @@ func (mi *MemoryIndex) Hashes() []plumbing.Hash {
}
// Add adds new node to the memory index
-func (mi *MemoryIndex) Add(hash plumbing.Hash, node *Node) error {
+func (mi *MemoryIndex) Add(hash plumbing.Hash, node *Node) {
// The parent indexes are calculated lazily in GetNodeByIndex
// which allows adding nodes out of order as long as all parents
// are eventually resolved
node.ParentIndexes = nil
mi.indexMap[hash] = len(mi.commitData)
mi.commitData = append(mi.commitData, node)
- return nil
}