Re: [PATCH] fsck: it is OK for a tag and a commit to lack the body
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Jun 29, 2015, 05:12 UTC
- Message-ID
- <32aa1979e75ba9bc6dc8a58fe32e9e55@www.dscho.org>
- In-Reply-To
- <xmqqlhf3elxk.fsf_-_@gitster.dls.corp.google.com>
Hi Junio,
On 2015-06-28 20:18, Junio C Hamano wrote:
Show 21 quoted lines
> diff --git a/fsck.c b/fsck.c > index 88c92e8..3f264e7 100644 > --- a/fsck.c > +++ b/fsck.c > @@ -255,6 +255,15 @@ static int require_end_of_header(const void > *data, unsigned long size, > } > } > > + /* > + * We did not find double-LF that separates the header > + * and the body. Not having a body is not a crime but > + * we do want to see the terminating LF for the last header > + * line. > + */ > + if (size && buffer[size - 1] == '\n') > + return 0; > + > return error_func(obj, FSCK_ERROR, "unterminated header"); > } >
Hmm. Maybe we should still warn when there is no empty line finishing the header explicitly, or at least make it FSCK_IGNORE by default so that maintainers who like a stricter check can upgrade the condition to an error?
Otherwise: ACK.
Ciao, Dscho