func NewCommitPreorderIter(
	c *Commit,
	seenExternal map[plumbing.Hash]bool,
	ignore []plumbing.Hash,
) CommitIter {
	seen := make(map[plumbing.Hash]bool)
	for _, h := range ignore {
		seen[h] = true
	}
	return &commitPreIterator{
		seenExternal: seenExternal,
		seen:         seen,
		stack:        make([]CommitIter, 0),
		start:        c,
	}
}
NewCommitPreorderIter returns a CommitIter that walks the commit history,
starting at the given commit and visiting its parents in pre-order.
The given callback will be called for each visited commit. Each commit will
be visited only once. If the callback returns an error, walking will stop
and will return the error. Other errors might be returned if the history
cannot be traversed (e.g. missing objects). Ignore allows to skip some
commits from being iterated.
package object
import (
	"io"
	"gopkg.in/src-d/go-git.v4/plumbing"
	"gopkg.in/src-d/go-git.v4/plumbing/storer"
)
type commitPreIterator struct {
	seenExternal map[plumbing.Hash]bool
	seen         map[plumbing.Hash]bool
	stack        []CommitIter
	start        *Commit
}