refs: cleanup comments regarding check_refname_component()
Correctly specify all characters which are rejected under the '4: a bad character' disposition, which did not list all characters that are treated as such. Cleanup comment style for rejected refs by inserting a ", or" at the end of each statement. Signed-off-by: Jacob Keller <jacob.keller@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jacob Keller committed
Jul 22, 2015 at 14:05 UTC
53a8555ee4db43534990126a14f0840f92aff898
1 file changed
+7
-5
refs.c
+7
-5
@@ -20,7 +20,8 @@ struct ref_lock {
20
* 1: End-of-component
21
* 2: ., look for a preceding . to reject .. in refs
22
* 3: {, look for a preceding @ to reject @{ in refs
23
- * 4: A bad character: ASCII control characters, "~", "^", ":" or SP
23
+ * 4: A bad character: ASCII control characters, and
24
+ * "*", ":", "?", "[", "\", "^", "~", SP, or TAB
25
*/
26
static unsigned char refname_disposition[256] = {
27
1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
@@ -71,10 +72,11 @@ static unsigned char refname_disposition[256] = {
72
*
73
* - any path component of it begins with ".", or
74
* - it has double dots "..", or
74
- * - it has ASCII control character, "~", "^", ":" or SP, anywhere, or
75
- * - it ends with a "/".
76
- * - it ends with ".lock"
77
- * - it contains a "\" (backslash)
75
+ * - it has ASCII control characters, or
76
+ * - it has "*", ":", "?", "[", "\", "^", "~", SP, or TAB anywhere, or
77
+ * - it ends with a "/", or
78
+ * - it ends with ".lock", or
79
+ * - it contains a "@{" portion
80
*/
81
static int check_refname_component(const char *refname, int flags)
82
{