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