提交 e0ae1e6f 编写于 作者: J Junio C Hamano

tests: remove unnecessary '^' from 'expr' regular expression

As Brandon noticed, a regular expression match given to 'expr' is already
anchored at the beginning.  Some versions of expr even complain about this.
Signed-off-by: NJunio C Hamano <gitster@pobox.com>
上级 99329771
......@@ -13,7 +13,7 @@ test_expect_success 'determine default editor' '
'
if ! expr "$vi" : '^[a-z]*$' >/dev/null
if ! expr "$vi" : '[a-z]*$' >/dev/null
then
vi=
fi
......
......@@ -109,7 +109,7 @@ test_expect_success TTY 'no pager with --no-pager' '
# for the first color; the text "commit" comes later.
colorful() {
read firstline <$1
! expr "$firstline" : "^[a-zA-Z]" >/dev/null
! expr "$firstline" : "[a-zA-Z]" >/dev/null
}
test_expect_success 'tests can detect color' '
......@@ -167,7 +167,7 @@ test_expect_success 'determine default pager' '
test -n "$less"
'
if expr "$less" : '^[a-z][a-z]*$' >/dev/null && test_have_prereq TTY
if expr "$less" : '[a-z][a-z]*$' >/dev/null && test_have_prereq TTY
then
test_set_prereq SIMPLEPAGER
fi
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册