aboutsummaryrefslogtreecommitdiff
path: root/refs.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2005-12-15 18:03:59 -0800
committerJunio C Hamano <junkio@cox.net>2005-12-16 18:23:52 -0800
commit68283999f8ae0e9286f8b7f199905b77d608cb80 (patch)
tree191914d18206d0b668db19685e27343ba6f599e6 /refs.c
parent3ae854c3567dd10055fbe12b8bd91bd2d447f55f (diff)
downloadgit-68283999f8ae0e9286f8b7f199905b77d608cb80.tar.gz
git-68283999f8ae0e9286f8b7f199905b77d608cb80.tar.xz
Forbid pattern maching characters in refnames.
by marking '?', '*', and '[' as bad_ref_char(). Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'refs.c')
-rw-r--r--refs.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/refs.c b/refs.c
index 69858e48c..7a2c56e64 100644
--- a/refs.c
+++ b/refs.c
@@ -313,7 +313,9 @@ int write_ref_sha1(const char *ref, int fd, const unsigned char *sha1)
static inline int bad_ref_char(int ch)
{
return (((unsigned) ch) <= ' ' ||
- ch == '~' || ch == '^' || ch == ':');
+ ch == '~' || ch == '^' || ch == ':' ||
+ /* 2.13 Pattern Matching Notation */
+ ch == '?' || ch == '*' || ch == '[');
}
int check_ref_format(const char *ref)