git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] refs.c: handle REFNAME_REFSPEC_PATTERN at end of page

From
David Turner <dturner@twopensource.com>
Date
Jul 5, 2014, 19:00 UTC
Message-ID
<1404586859-24464-1-git-send-email-dturner@twitter.com>
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
Previous: Øyvind A. HolmNext: Øyvind A. Holm
Message 8 of 14 in “t5150-request-pull.sh fails on newest master in Debian”
  1. Øyvind A. HolmJul 3, 2014
  2. David TurnerJul 3, 2014
  3. Øyvind A. HolmJul 3, 2014
  4. David TurnerJul 4, 2014
  5. Øyvind A. HolmJul 5, 2014
  6. David TurnerJul 5, 2014
  7. Øyvind A. HolmJul 5, 2014
  8. refs.c: handle REFNAME_REFSPEC_PATTERN at end of pageDavid Turner, Jul 5, 2014
  9. Øyvind A. HolmJul 9, 2014
  10. David TurnerJul 9, 2014
  11. Øyvind A. HolmJul 9, 2014
  12. René ScharfeJul 9, 2014
  13. Øyvind A. HolmJul 3, 2014
  14. Øyvind A. HolmJul 9, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.