[PATCH 1/6] t4061: use POSIX compliance regex(7)
- From
Đoàn Trần Công Danh <congdanhqx@gmail.com>
- Date
- Mar 19, 2020, 14:00 UTC
- Message-ID
- <c45d6383173d8d3e73cdcdd6e993d3259d519a68.1584625896.git.congdanhqx@gmail.com>
- In-Reply-To
- <cover.1584625896.git.congdanhqx@gmail.com>
BRE interprets `+` literally, and `\+` is undefined for POSIX BRE, from: https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap09.html#tag_09_03_02
Show 5 quoted lines
> The interpretation of an ordinary character preceded
> by an unescaped <backslash> ( '\\' ) is undefined, except for:
> - The characters ')', '(', '{', and '}'
> - The digits 1 to 9 inclusive
> - A character inside a bracket expressionThis test is failing with busybox sed, the default sed of Alpine Linux
Fix it by using literal `+` instead.
Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com> --- t/t4061-diff-indent.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/t/t4061-diff-indent.sh b/t/t4061-diff-indent.sh index 2affd7a100..0f7a6d97a8 100755 --- a/t/t4061-diff-indent.sh +++ b/t/t4061-diff-indent.sh @@ -17,7 +17,7 @@ compare_diff () { # Compare blame output using the expectation for a diff as reference. # Only look for the lines coming from non-boundary commits. compare_blame () { - sed -n -e "1,4d" -e "s/^\+//p" <"$1" >.tmp-1 + sed -n -e "1,4d" -e "s/^+//p" <"$1" >.tmp-1 sed -ne "s/^[^^][^)]*) *//p" <"$2" >.tmp-2 test_cmp .tmp-1 .tmp-2 && rm -f .tmp-1 .tmp-2 }
-- 2.26.0.rc2.234.g969ad452ca