提交 2e582df0 编写于 作者: E Eric Sunshine 提交者: Junio C Hamano

t7508: avoid non-portable sed expression

2556b996 (status: disable display of '#' comment prefix by default;
2013-09-06) introduced tests which fail on Mac OS X due to unportable
use of \t (for TAB) in a sed expression. POSIX [1][2] also disallows
it. Fix this.

[1]: http://pubs.opengroup.org/onlinepubs/9699919799/utilities/sed.html#tag_20_116_13_02
[2]: http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap09.html#tag_09_03_02Signed-off-by: NEric Sunshine <sunshine@sunshineco.com>
Acked-by: NMatthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: NJunio C Hamano <gitster@pobox.com>
上级 2f0f7f1c
......@@ -61,7 +61,8 @@ test_expect_success 'status (1)' '
'
strip_comments () {
sed "s/^\# //; s/^\#$//; s/^#\t/\t/" <"$1" >"$1".tmp &&
tab=' '
sed "s/^\# //; s/^\#$//; s/^#$tab/$tab/" <"$1" >"$1".tmp &&
rm "$1" && mv "$1".tmp "$1"
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册