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

Commit

Permalink
Improve error handling logic
Browse files Browse the repository at this point in the history
Signed-off-by: Antonio Jesus Navarro Perez <antnavper@gmail.com>
  • Loading branch information
ajnavarro committed Feb 13, 2019
1 parent 6c2a0da commit 2b24822
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions plumbing/object/commit_walker.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,12 +197,12 @@ func NewCommitAllIter(repoStorer storage.Storer, commitIterFunc func(*Commit) Co
commitsPath := list.New()
commitsLookup := make(map[plumbing.Hash]*list.Element)
head, err := storer.ResolveReference(repoStorer, plumbing.HEAD)
if err == nil {
err = addReference(repoStorer, commitIterFunc, head, commitsPath, commitsLookup)
}

if err != nil && err != plumbing.ErrReferenceNotFound {
return nil, err
} else if err != plumbing.ErrReferenceNotFound {
if err = addReference(repoStorer, commitIterFunc, head, commitsPath, commitsLookup); err != nil {
return nil, err
}
}

// add all references along with the HEAD
Expand Down

0 comments on commit 2b24822

Please sign in to comment.