git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lukas Fleischer <git@cryptocrack.de>
To: git@vger.kernel.org
Subject: [PATCH 1/2] bundle: Accept prerequisites without commit messages
Date: Sun,  7 Apr 2013 13:53:15 +0200	[thread overview]
Message-ID: <1365335596-19917-1-git-send-email-git@cryptocrack.de> (raw)

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. Fix this off-by-one error and only require lines with
more than 40 characters to contain the separating space.

Signed-off-by: Lukas Fleischer <git@cryptocrack.de>
---
 bundle.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bundle.c b/bundle.c
index 505e07e..4b0e5cd 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)"),
-- 
1.8.2.675.gda3bb24.dirty

             reply	other threads:[~2013-04-07 11:53 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-07 11:53 Lukas Fleischer [this message]
2013-04-07 11:53 ` [PATCH 2/2] t5704: Test prerequisites with empty commit messages Lukas Fleischer
2013-04-07 15:24 ` [PATCH 1/2] bundle: Accept prerequisites without " Lukas Fleischer
2013-04-07 17:21 ` Junio C Hamano
2013-04-07 17:29   ` Junio C Hamano
2013-04-08  1:06   ` Jeff King
2013-04-08  9:53     ` Lukas Fleischer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1365335596-19917-1-git-send-email-git@cryptocrack.de \
    --to=git@cryptocrack.de \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).