]> git.ipfire.org Git - thirdparty/git.git/commitdiff
t7508: avoid non-portable sed expression
authorEric Sunshine <sunshine@sunshineco.com>
Sat, 14 Sep 2013 04:47:12 +0000 (00:47 -0400)
committerJunio C Hamano <gitster@pobox.com>
Tue, 17 Sep 2013 17:17:33 +0000 (10:17 -0700)
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_02

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Acked-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t7508-status.sh

index 9bf97017c090386b7cae6bfbc9b3f9caeb83bdab..d8c531da765009b3b2261f1263a399b1d4c2a8b5 100755 (executable)
@@ -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"
 }