From 5446e33f35d6b27b6b760a59a6ded33fbd555190 Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Sun, 7 Apr 2013 13:53:15 +0200 Subject: bundle: Accept prerequisites without commit messages While explicitly stating that the commit message in a prerequisite line is optional, we required all lines with 40 or more characters to contain a space after the object name, bailing out if a line consisted of an object name only. This was to allow bundling a history to a commit without an message, but the code forgot that it already called rtrim() to remove that whitespace. As a workaround, only check for SP when the line has more than 40 characters. Signed-off-by: Lukas Fleischer Signed-off-by: Junio C Hamano --- bundle.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'bundle.c') diff --git a/bundle.c b/bundle.c index 505e07e93..4b0e5cd51 100644 --- a/bundle.c +++ b/bundle.c @@ -57,7 +57,7 @@ static int parse_bundle_header(int fd, struct bundle_header *header, * followed by SP and subject line. */ if (get_sha1_hex(buf.buf, sha1) || - (40 <= buf.len && !isspace(buf.buf[40])) || + (buf.len > 40 && !isspace(buf.buf[40])) || (!is_prereq && buf.len <= 40)) { if (report_path) error(_("unrecognized header: %s%s (%d)"), -- cgit v1.2.1