Merge pull request #60 from taylorotwell/master

Fallback value for committer email
This commit is contained in:
Fabien Potencier 2021-05-12 15:24:27 +02:00 committed by GitHub
commit 01594a43d0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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
}