diff options
-rw-r--r-- | plumbing/object/commit_walker.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/plumbing/object/commit_walker.go b/plumbing/object/commit_walker.go index ab06cb2..92c6572 100644 --- a/plumbing/object/commit_walker.go +++ b/plumbing/object/commit_walker.go @@ -225,18 +225,18 @@ func NewCommitAllIter(s storage.Storer, fn func(*Commit) CommitIter) (CommitIter // we already have the HEAD return nil } - c, _ := GetCommit(s, r.Hash()) - // if it's not a commit - skip it. - if c == nil { - return nil - } - el, ok := m[c.Hash] + el, ok := m[r.Hash()] if ok { return nil } var refCommits []*Commit + c, _ := GetCommit(s, r.Hash()) + // if it's not a commit - skip it. + if c == nil { + return nil + } cit := fn(c) for c, e := cit.Next(); e == nil; { el, ok = m[c.Hash] |