Skip to content
This repository was archived by the owner on Sep 11, 2020. It is now read-only.

Commit 695054a

Browse files
committed
plumbing: format/commitgraph, clean up error handling
Signed-off-by: Filip Navara <[email protected]>
1 parent 5c6d199 commit 695054a

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

plumbing/format/commitgraph/file.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ import (
1414
var (
1515
// ErrUnsupportedVersion is returned by OpenFileIndex when the commit graph
1616
// file version is not supported.
17-
ErrUnsupportedVersion = errors.New("Unsuported version")
17+
ErrUnsupportedVersion = errors.New("Unsupported version")
1818
// ErrUnsupportedHash is returned by OpenFileIndex when the commit graph
1919
// hash function is not supported. Currently only SHA-1 is defined and
2020
// supported
21-
ErrUnsupportedHash = errors.New("Unsuported hash algorithm")
21+
ErrUnsupportedHash = errors.New("Unsupported hash algorithm")
2222
// ErrMalformedCommitGraphFile is returned by OpenFileIndex when the commit
2323
// graph file is corrupted.
2424
ErrMalformedCommitGraphFile = errors.New("Malformed commit graph file")

plumbing/format/commitgraph/memory.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,11 @@ func (mi *MemoryIndex) Hashes() []plumbing.Hash {
6060
}
6161

6262
// Add adds new node to the memory index
63-
func (mi *MemoryIndex) Add(hash plumbing.Hash, node *Node) error {
63+
func (mi *MemoryIndex) Add(hash plumbing.Hash, node *Node) {
6464
// The parent indexes are calculated lazily in GetNodeByIndex
6565
// which allows adding nodes out of order as long as all parents
6666
// are eventually resolved
6767
node.ParentIndexes = nil
6868
mi.indexMap[hash] = len(mi.commitData)
6969
mi.commitData = append(mi.commitData, node)
70-
return nil
7170
}

0 commit comments

Comments
 (0)