git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Turner <dturner@twopensource.com>
To: git@vger.kernel.org, "Øyvind A . Holm" <sunny@sunbase.org>
Cc: David Turner <dturner@twitter.com>
Subject: [PATCH] refs.c: handle REFNAME_REFSPEC_PATTERN at end of page
Date: Sat,  5 Jul 2014 12:00:59 -0700	[thread overview]
Message-ID: <1404586859-24464-1-git-send-email-dturner@twitter.com> (raw)
In-Reply-To: <CAA787rnMonCuON+C0U5FDXKzjTBdpOusCpGLeWytDWaA1torEw@mail.gmail.com>

When a ref crosses a memory page boundary, we restart the parsing
at the beginning with the bytewise code.  Pass the original flags
to that code, rather than the current flags.

Signed-off-by: David Turner <dturner@twitter.com>
---
 refs.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/refs.c b/refs.c
index 20e2bf1..82e4842 100644
--- a/refs.c
+++ b/refs.c
@@ -153,6 +153,7 @@ int check_refname_format(const char *refname, int flags)
 	const __m128i tilde_lb = _mm_set1_epi8('~' - 1);
 
 	int component_count = 0;
+	int orig_flags = flags;
 
 	if (refname[0] == 0 || refname[0] == '/') {
 		/* entirely empty ref or initial ref component */
@@ -178,7 +179,7 @@ int check_refname_format(const char *refname, int flags)
 			 * End-of-page; fall back to slow method for
 			 * this entire ref.
 			 */
-			return check_refname_format_bytewise(refname, flags);
+			return check_refname_format_bytewise(refname, orig_flags);
 
 		tmp = _mm_loadu_si128((__m128i *)cp);
 		tmp1 = _mm_loadu_si128((__m128i *)(cp + 1));
-- 
2.0.0.390.gcb682f8

  reply	other threads:[~2014-07-05 19:04 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-03 21:55 t5150-request-pull.sh fails on newest master in Debian Øyvind A. Holm
2014-07-03 22:16 ` David Turner
     [not found]   ` <CAA787rmroFsjk9=ar0e_4o3hUpfDBi+9J4nrNyHHMZq-5q4skw@mail.gmail.com>
2014-07-03 23:02     ` Øyvind A. Holm
2014-07-03 22:19 ` Øyvind A. Holm
2014-07-04 20:22 ` David Turner
2014-07-05  0:09   ` Øyvind A. Holm
2014-07-05  1:58     ` David Turner
2014-07-05 14:24       ` Øyvind A. Holm
2014-07-05 19:00         ` David Turner [this message]
     [not found]           ` <xmqq7g3pdoy7.fsf@gitster.dls.corp.google.com>
2014-07-09 11:48             ` [PATCH] refs.c: handle REFNAME_REFSPEC_PATTERN at end of page Øyvind A. Holm
2014-07-09  0:52         ` t5150-request-pull.sh fails on newest master in Debian Øyvind A. Holm
2014-07-09  1:18           ` David Turner
2014-07-09 11:44             ` Øyvind A. Holm
2014-07-09 14:52             ` René Scharfe

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=1404586859-24464-1-git-send-email-dturner@twitter.com \
    --to=dturner@twopensource.com \
    --cc=dturner@twitter.com \
    --cc=git@vger.kernel.org \
    --cc=sunny@sunbase.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).