fallback value for committer email

This commit is contained in:
Taylor Otwell 2021-05-11 14:48:41 -05:00
parent faf40091fa
commit 9b1b817de9

View file

@ -477,7 +477,12 @@ func (s *state) copyCommit(rev *git.Commit, tree *git.Tree, parents []*git.Commi
author.Email = "nobody@example.com"
}
oid, err := s.repo.CreateCommit("", author, rev.Committer(), message, tree, parents...)
committer := rev.Committer()
if committer.Email == "" {
committer.Email = "nobody@example.com"
}
oid, err := s.repo.CreateCommit("", author, committer, message, tree, parents...)
if err != nil {
return nil, err
}