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

Commit f65d7f4

Browse files
author
kuba--
committed
First lookup if hash exists, then GetCommit.
Signed-off-by: kuba-- <[email protected]>
1 parent 3180dff commit f65d7f4

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

plumbing/object/commit_walker.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -225,18 +225,18 @@ func NewCommitAllIter(s storage.Storer, fn func(*Commit) CommitIter) (CommitIter
225225
// we already have the HEAD
226226
return nil
227227
}
228-
c, _ := GetCommit(s, r.Hash())
229-
// if it's not a commit - skip it.
230-
if c == nil {
231-
return nil
232-
}
233228

234-
el, ok := m[c.Hash]
229+
el, ok := m[r.Hash()]
235230
if ok {
236231
return nil
237232
}
238233

239234
var refCommits []*Commit
235+
c, _ := GetCommit(s, r.Hash())
236+
// if it's not a commit - skip it.
237+
if c == nil {
238+
return nil
239+
}
240240
cit := fn(c)
241241
for c, e := cit.Next(); e == nil; {
242242
el, ok = m[c.Hash]

0 commit comments

Comments
 (0)