diff options
author | Junio C Hamano <junkio@cox.net> | 2005-12-15 18:03:59 -0800 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2005-12-16 18:23:52 -0800 |
commit | 68283999f8ae0e9286f8b7f199905b77d608cb80 (patch) | |
tree | 191914d18206d0b668db19685e27343ba6f599e6 /refs.c | |
parent | 3ae854c3567dd10055fbe12b8bd91bd2d447f55f (diff) | |
download | git-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.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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) |