提交 53a8555e 编写于 作者: J Jacob Keller 提交者: Junio C Hamano

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: NJacob Keller <jacob.keller@gmail.com>
Signed-off-by: NJunio C Hamano <gitster@pobox.com>
上级 bb3e7b1a
...@@ -20,7 +20,8 @@ struct ref_lock { ...@@ -20,7 +20,8 @@ struct ref_lock {
* 1: End-of-component * 1: End-of-component
* 2: ., look for a preceding . to reject .. in refs * 2: ., look for a preceding . to reject .. in refs
* 3: {, look for a preceding @ to reject @{ in refs * 3: {, look for a preceding @ to reject @{ in refs
* 4: A bad character: ASCII control characters, "~", "^", ":" or SP * 4: A bad character: ASCII control characters, and
* "*", ":", "?", "[", "\", "^", "~", SP, or TAB
*/ */
static unsigned char refname_disposition[256] = { static unsigned char refname_disposition[256] = {
1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 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] = { ...@@ -71,10 +72,11 @@ static unsigned char refname_disposition[256] = {
* *
* - any path component of it begins with ".", or * - any path component of it begins with ".", or
* - it has double dots "..", or * - it has double dots "..", or
* - it has ASCII control character, "~", "^", ":" or SP, anywhere, or * - it has ASCII control characters, or
* - it ends with a "/". * - it has "*", ":", "?", "[", "\", "^", "~", SP, or TAB anywhere, or
* - it ends with ".lock" * - it ends with a "/", or
* - it contains a "\" (backslash) * - it ends with ".lock", or
* - it contains a "@{" portion
*/ */
static int check_refname_component(const char *refname, int flags) static int check_refname_component(const char *refname, int flags)
{ {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册