提交 e19e5e66 编写于 作者: J Jeff King

verify_path: drop clever fallthrough

We check ".git" and ".." in the same switch statement, and
fall through the cases to share the end-of-component check.
While this saves us a line or two, it makes modifying the
function much harder. Let's just write it out.
Signed-off-by: NJeff King <peff@peff.net>
上级 41a80924
......@@ -810,8 +810,7 @@ static int verify_dotfile(const char *rest)
switch (*rest) {
/*
* ".git" followed by NUL or slash is bad. This
* shares the path end test with the ".." case.
* ".git" followed by NUL or slash is bad.
*/
case 'g':
case 'G':
......@@ -819,8 +818,9 @@ static int verify_dotfile(const char *rest)
break;
if (rest[2] != 't' && rest[2] != 'T')
break;
rest += 2;
/* fallthrough */
if (rest[3] == '\0' || is_dir_sep(rest[3]))
return 0;
break;
case '.':
if (rest[1] == '\0' || is_dir_sep(rest[1]))
return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册