Skip to content

Commit 53a8555

Browse files
jacob-kellergitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent bb3e7b1 commit 53a8555

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

refs.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ struct ref_lock {
2020
* 1: End-of-component
2121
* 2: ., look for a preceding . to reject .. in refs
2222
* 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
2425
*/
2526
static unsigned char refname_disposition[256] = {
2627
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] = {
7172
*
7273
* - any path component of it begins with ".", or
7374
* - 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
7880
*/
7981
static int check_refname_component(const char *refname, int flags)
8082
{

0 commit comments

Comments
 (0)