test: avoid pipes in git related commands for test
[gitweb.git] / t / t9130-git-svn-authors-file.sh
index 41264818ccdd85abb4b0a17c8a508d4bcbfe57f5..7752a1faeb0cc9e96b318af37d24b79a545a9b3c 100755 (executable)
@@ -26,11 +26,12 @@ test_expect_success 'start import with incomplete authors file' '
 test_expect_success 'imported 2 revisions successfully' '
        (
                cd x
-               test "$(git rev-list refs/remotes/git-svn | wc -l)" -eq 2 &&
-               git rev-list -1 --pretty=raw refs/remotes/git-svn | \
-                 grep "^author BBBBBBB BBBBBBB <bb@example\.com> " &&
-               git rev-list -1 --pretty=raw refs/remotes/git-svn~1 | \
-                 grep "^author AAAAAAA AAAAAAA <aa@example\.com> "
+               git rev-list refs/remotes/git-svn >actual &&
+               test_line_count = 2 actual &&
+               git rev-list -1 --pretty=raw refs/remotes/git-svn >actual &&
+               grep "^author BBBBBBB BBBBBBB <bb@example\.com> " actual &&
+               git rev-list -1 --pretty=raw refs/remotes/git-svn~1 >actual &&
+               grep "^author AAAAAAA AAAAAAA <aa@example\.com> " actual
        )
        '
 
@@ -43,11 +44,12 @@ test_expect_success 'continues to import once authors have been added' '
        (
                cd x
                git svn fetch --authors-file=../svn-authors &&
-               test "$(git rev-list refs/remotes/git-svn | wc -l)" -eq 4 &&
-               git rev-list -1 --pretty=raw refs/remotes/git-svn | \
-                 grep "^author DDDDDDD DDDDDDD <dd@example\.com> " &&
-               git rev-list -1 --pretty=raw refs/remotes/git-svn~1 | \
-                 grep "^author CCCCCCC CCCCCCC <cc@example\.com> "
+               git rev-list refs/remotes/git-svn >actual &&
+               test_line_count = 4 actual &&
+               git rev-list -1 --pretty=raw refs/remotes/git-svn >actual &&
+               grep "^author DDDDDDD DDDDDDD <dd@example\.com> " actual &&
+               git rev-list -1 --pretty=raw refs/remotes/git-svn~1 >actual &&
+               grep "^author CCCCCCC CCCCCCC <cc@example\.com> " actual
        )
        '
 
@@ -102,8 +104,10 @@ test_expect_success !MINGW 'fresh clone with svn.authors-file in config' '
                test x"$HOME"/svn-authors = x"$(git config svn.authorsfile)" &&
                git svn clone "$svnrepo" gitconfig.clone &&
                cd gitconfig.clone &&
-               nr_ex=$(git log | grep "^Author:.*example.com" | wc -l) &&
-               nr_rev=$(git rev-list HEAD | wc -l) &&
+               git log >actual &&
+               nr_ex=$(grep "^Author:.*example.com" actual | wc -l) &&
+               git rev-list HEAD >actual &&
+               nr_rev=$(wc -l <actual) &&
                test $nr_rev -eq $nr_ex
        )
 '