Skip to content

Commit 5317dfe

Browse files
sgngitster
authored andcommitted
t: use configured TAR instead of tar
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 48bf2fa commit 5317dfe

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

t/t3513-revert-submodule.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ test_description='revert can handle submodules'
1414
git_revert () {
1515
git status -su >expect &&
1616
ls -1pR * >>expect &&
17-
tar cf "$TRASH_DIRECTORY/tmp.tar" * &&
17+
"$TAR" cf "$TRASH_DIRECTORY/tmp.tar" * &&
1818
may_only_be_test_must_fail "$2" &&
1919
$2 git checkout "$1" &&
2020
if test -n "$2"
@@ -23,7 +23,7 @@ git_revert () {
2323
fi &&
2424
git revert HEAD &&
2525
rm -rf * &&
26-
tar xf "$TRASH_DIRECTORY/tmp.tar" &&
26+
"$TAR" xf "$TRASH_DIRECTORY/tmp.tar" &&
2727
git status -su >actual &&
2828
ls -1pR * >>actual &&
2929
test_cmp expect actual &&

t/t6041-bisect-submodule.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ test_description='bisect can handle submodules'
88
git_bisect () {
99
git status -su >expect &&
1010
ls -1pR * >>expect &&
11-
tar cf "$TRASH_DIRECTORY/tmp.tar" * &&
11+
"$TAR" cf "$TRASH_DIRECTORY/tmp.tar" * &&
1212
GOOD=$(git rev-parse --verify HEAD) &&
1313
may_only_be_test_must_fail "$2" &&
1414
$2 git checkout "$1" &&
@@ -25,7 +25,7 @@ git_bisect () {
2525
git bisect start &&
2626
git bisect good $GOOD &&
2727
rm -rf * &&
28-
tar xf "$TRASH_DIRECTORY/tmp.tar" &&
28+
"$TAR" xf "$TRASH_DIRECTORY/tmp.tar" &&
2929
git status -su >actual &&
3030
ls -1pR * >>actual &&
3131
test_cmp expect actual &&

0 commit comments

Comments
 (0)