]> git.ipfire.org Git - thirdparty/git.git/commitdiff
t5703: replace "grep -a" usage by perl
authorĐoàn Trần Công Danh <congdanhqx@gmail.com>
Tue, 19 May 2020 00:50:46 +0000 (07:50 +0700)
committerJunio C Hamano <gitster@pobox.com>
Tue, 19 May 2020 18:15:23 +0000 (11:15 -0700)
On some platforms likes HP-UX, grep(1) doesn't understand "-a".
Let's switch to perl.

Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t5703-upload-pack-ref-in-want.sh

index 7fba3063bf9150687df4bcbd56cdfecf50c8e289..8e559799c03354e658bb31492182be2b27060d2c 100755 (executable)
@@ -52,15 +52,18 @@ test_expect_success 'setup repository' '
 
 test_expect_success 'config controls ref-in-want advertisement' '
        test-tool serve-v2 --advertise-capabilities >out &&
-       ! grep -a ref-in-want out &&
+       perl -ne "/ref-in-want/ and print" out >out.filter &&
+       test_must_be_empty out.filter &&
 
        git config uploadpack.allowRefInWant false &&
        test-tool serve-v2 --advertise-capabilities >out &&
-       ! grep -a ref-in-want out &&
+       perl -ne "/ref-in-want/ and print" out >out.filter &&
+       test_must_be_empty out.filter &&
 
        git config uploadpack.allowRefInWant true &&
        test-tool serve-v2 --advertise-capabilities >out &&
-       grep -a ref-in-want out
+       perl -ne "/ref-in-want/ and print" out >out.filter &&
+       test_file_not_empty out.filter
 '
 
 test_expect_success 'invalid want-ref line' '