]> git.ipfire.org Git - thirdparty/git.git/commitdiff
t: use configured TAR instead of tar
authorĐoàn Trần Công Danh <congdanhqx@gmail.com>
Sat, 22 May 2021 07:10:08 +0000 (14:10 +0700)
committerJunio C Hamano <gitster@pobox.com>
Sat, 22 May 2021 09:01:57 +0000 (18:01 +0900)
Despite that tar is available everywhere, it's not required by POSIX.

In our build system, users are allowed to specify which tar to be used
in Makefile knobs. Furthermore, GNU tar (gtar) is prefered when autotools
is being used.

In our testsuite, 7 out of 9 tar-required-tests use "$TAR", the other
two use "tar".

Let's change the remaining two tests to "$TAR".

Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t3513-revert-submodule.sh
t/t6041-bisect-submodule.sh

index a759f12cbb1d6b7676d639806cdbe94e1cc201ac..6e21278cfe77c8f3f1828f56a6adedbbeb0ea67d 100755 (executable)
@@ -14,7 +14,7 @@ test_description='revert can handle submodules'
 git_revert () {
        git status -su >expect &&
        ls -1pR * >>expect &&
-       tar cf "$TRASH_DIRECTORY/tmp.tar" * &&
+       "$TAR" cf "$TRASH_DIRECTORY/tmp.tar" * &&
        may_only_be_test_must_fail "$2" &&
        $2 git checkout "$1" &&
        if test -n "$2"
@@ -23,7 +23,7 @@ git_revert () {
        fi &&
        git revert HEAD &&
        rm -rf * &&
-       tar xf "$TRASH_DIRECTORY/tmp.tar" &&
+       "$TAR" xf "$TRASH_DIRECTORY/tmp.tar" &&
        git status -su >actual &&
        ls -1pR * >>actual &&
        test_cmp expect actual &&
index df1eff0fb831e3ede980157c577c575feab04a4d..82013fc9037c1dd67cfda1a0206f6b73a2869677 100755 (executable)
@@ -8,7 +8,7 @@ test_description='bisect can handle submodules'
 git_bisect () {
        git status -su >expect &&
        ls -1pR * >>expect &&
-       tar cf "$TRASH_DIRECTORY/tmp.tar" * &&
+       "$TAR" cf "$TRASH_DIRECTORY/tmp.tar" * &&
        GOOD=$(git rev-parse --verify HEAD) &&
        may_only_be_test_must_fail "$2" &&
        $2 git checkout "$1" &&
@@ -25,7 +25,7 @@ git_bisect () {
        git bisect start &&
        git bisect good $GOOD &&
        rm -rf * &&
-       tar xf "$TRASH_DIRECTORY/tmp.tar" &&
+       "$TAR" xf "$TRASH_DIRECTORY/tmp.tar" &&
        git status -su >actual &&
        ls -1pR * >>actual &&
        test_cmp expect actual &&