Re: [PATCH v6 09/19] fsck: Handle multiple authors in commits specially
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jun 19, 2015, 20:16 UTC
- Message-ID
- <xmqqioaj78tl.fsf@gitster.dls.corp.google.com>
- In-Reply-To
- <eb82bbfc658e8af1db03f7197b38aaaec33fd4ad.1434720655.git.johannes.schindelin@gmx.de>
Johannes Schindelin <johannes.schindelin@gmx.de> writes:
Show 11 quoted lines
> err = fsck_ident(&buffer, &commit->object, options);
> if (err)
> return err;
> + while (skip_prefix(buffer, "author ", &buffer)) {
> + err = report(options, &commit->object, FSCK_MSG_MULTIPLE_AUTHORS, "invalid format - multiple 'author' lines");
> + if (err)
> + return err;
> + err = fsck_ident(&buffer, &commit->object, options);
> + if (err)
> + return err;
> + }Hmph, naively I would have expected that you wouldn't need an extra call to fsck_ident() here, and instead would see something like this:
author_count = 0;
while (skip_prefix("author ")) {
author_count++;
... do the existing check as-is ...
}
if (author_count < 1)
err |= report(missing author);
else if (author_count > 1)
err |= report(multiple authors);