Re: [PATCH 2/4] t: remove \{m,n\} from BRE grep usage
On Tue, Sep 20, 2022 at 10:49:14PM +0700, Đoàn Trần Công Danh wrote:
Show 28 quoted lines
> \{m,n\} is a GNU extension to BRE, and it's forbidden by our
> CodingGuidelines.
>
> Change to fixed strings or ERE.
>
> Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
> ---
> t/t3200-branch.sh | 6 ++++--
> t/t3305-notes-fanout.sh | 2 +-
> t/t3404-rebase-interactive.sh | 6 +++---
> t/t5550-http-fetch-dumb.sh | 2 +-
> t/t5702-protocol-v2.sh | 2 +-
> 5 files changed, 10 insertions(+), 8 deletions(-)
>
> diff --git a/t/t3200-branch.sh b/t/t3200-branch.sh
> index 9723c2827c..f05ac1fe0b 100755
> --- a/t/t3200-branch.sh
> +++ b/t/t3200-branch.sh
> @@ -201,8 +201,10 @@ test_expect_success 'git branch -M baz bam should succeed when baz is checked ou
>
> test_expect_success 'git branch -M baz bam should add entries to .git/logs/HEAD' '
> msg="Branch: renamed refs/heads/baz to refs/heads/bam" &&
> - grep " 0\{40\}.*$msg$" .git/logs/HEAD &&
> - grep "^0\{40\}.*$msg$" .git/logs/HEAD
> + zero="00000000" &&
> + zero="$zero$zero$zero$zero$zero" &&
> + grep " $zero.*$msg$" .git/logs/HEAD &&
> + grep "^$zero.*$msg$" .git/logs/HEADI think these could use $ZERO_OID instead.