- if (!skip_prefix(buffer, "author ", &buffer))
- return report(options, &commit->object, FSCK_MSG_MISSING_AUTHOR, "invalid format - expected 'author' line");
- err = fsck_ident(&buffer, &commit->object, options);
+ author_count = 0;
+ while (skip_prefix(buffer, "author ", &buffer)) {
+ author_count++;
+ err = fsck_ident(&buffer, &commit->object, options);
+ if (err)
+ return err;
+ }
+ if (author_count < 1)
+ err = report(options, &commit->object, FSCK_MSG_MISSING_AUTHOR, "invalid format - expected 'author' line");
+ else if (author_count > 1)
+ err = report(options, &commit->object, FSCK_MSG_MULTIPLE_AUTHORS, "invalid format - multiple 'author' lines");