···498498 // commit will not be signed. The private key must be present and already
499499 // decrypted.
500500 SignKey *openpgp.Entity
501501+ // Amend will create a new commit object and replace the commit that HEAD currently
502502+ // points to. Cannot be used with All nor Parents.
503503+ Amend bool
501504}
502505503506// Validate validates the fields and sets the default values.
504507func (o *CommitOptions) Validate(r *Repository) error {
508508+ if o.All && o.Amend {
509509+ return errors.New("all and amend cannot be used together")
510510+ }
511511+512512+ if o.Amend && len(o.Parents) > 0 {
513513+ return errors.New("parents cannot be used with amend")
514514+ }
515515+505516 if o.Author == nil {
506517 if err := o.loadConfigAuthorAndCommitter(r); err != nil {
507518 return err