login
Header Space

 
 

Re: [PATCH v2] Bisect reset: remove bisect refs that may have been packed.

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Johannes Sixt <j.sixt@...>
Cc: Junio C Hamano <gitster@...>, Christian Couder <chriscool@...>, <git@...>
Date: Thursday, November 15, 2007 - 4:49 am

Johannes Sixt <j.sixt@viscovery.net> wrote:

What's this obsession with whitespace in refnames?  Twice in like
two days people are talking about whitespace in refnames.

WHITESPACE IS NOT PERMITTED IN REFNAMES.

Do we need to apply the following patch, to keep people from creating
refs by hand with whitespace in them?  Is this really that common?

	git rev-parse HEAD >'.git/refs/heads/..i have spaces hah!'


diff --git a/refs.c b/refs.c
index aff02cd..b95bf83 100644
--- a/refs.c
+++ b/refs.c
@@ -246,6 +246,7 @@ static struct ref_list *get_ref_dir(const char *base, struct ref_list *list)
 			struct stat st;
 			int flag;
 			int namelen;
+			int check;
 
 			if (de->d_name[0] == '.')
 				continue;
@@ -261,6 +262,9 @@ static struct ref_list *get_ref_dir(const char *base, struct ref_list *list)
 				list = get_ref_dir(ref, list);
 				continue;
 			}
+			check = check_ref_format(ref);
+			if (check != 0 && check != -2)
+				continue;
 			if (!resolve_ref(ref, sha1, 1, &flag)) {
 				error("%s points nowhere!", ref);
 				continue;

-- 
Shawn.
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 3/3] git-bisect: modernize branch shuffling hack, Junio C Hamano, (Thu Nov 15, 5:01 am)
[PATCH 1/3] git-bisect: war on "sed", Junio C Hamano, (Thu Nov 15, 5:00 am)
Re: [PATCH 1/3] git-bisect: war on "sed", Miles Bader, (Thu Nov 15, 5:29 am)
Re: [PATCH 1/3] git-bisect: war on "sed", Wincent Colaiuta, (Thu Nov 15, 5:36 am)
Re: [PATCH 1/3] git-bisect: war on "sed", Miles Bader, (Thu Nov 15, 5:53 am)
Re: [PATCH 1/3] git-bisect: war on "sed", Andreas Ericsson, (Thu Nov 15, 6:06 am)
Re: [PATCH 1/3] git-bisect: war on "sed", David Kastrup, (Thu Nov 15, 6:14 am)
Re: [PATCH v2] Bisect reset: remove bisect refs that may hav..., Shawn O. Pearce, (Thu Nov 15, 4:49 am)
Re: [PATCH v2] Bisect reset: remove bisect refs that may hav..., Johannes Schindelin, (Thu Nov 15, 8:10 am)
speck-geostationary