test: make FILEMODE a lazy prereq

This way, test authors don't need to remember to source
lib-prereq-FILEMODE.sh before using the FILEMODE prereq to guard tests
that rely on the executable bit being honored when checking out files.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Jonathan Nieder 2013-11-25 13:02:16 -08:00 committed by Junio C Hamano
parent 30a3318ac0
commit b018c73526
8 changed files with 4 additions and 17 deletions

View File

@ -1,11 +0,0 @@
#!/bin/sh
#
# Copyright (c) 2010 Ævar Arnfjörð Bjarmason
#
if test "$(git config --bool core.filemode)" = false
then
say 'filemode disabled on the filesystem'
else
test_set_prereq FILEMODE
fi

View File

@ -2,7 +2,6 @@
test_description='add -i basic tests'
. ./test-lib.sh
. "$TEST_DIRECTORY"/lib-prereq-FILEMODE.sh
if ! test_have_prereq PERL
then

View File

@ -7,7 +7,6 @@ test_description='git apply handling copy/rename patch.
'
. ./test-lib.sh
. "$TEST_DIRECTORY"/lib-prereq-FILEMODE.sh
# setup

View File

@ -6,7 +6,6 @@
test_description='git apply -p handling.'
. ./test-lib.sh
. "$TEST_DIRECTORY"/lib-prereq-FILEMODE.sh
test_expect_success setup '
mkdir sub &&

View File

@ -3,7 +3,6 @@
test_description='applying patch with mode bits'
. ./test-lib.sh
. "$TEST_DIRECTORY"/lib-prereq-FILEMODE.sh
test_expect_success setup '
echo original >file &&

View File

@ -2,7 +2,6 @@
test_description='merge-recursive: handle file mode'
. ./test-lib.sh
. "$TEST_DIRECTORY"/lib-prereq-FILEMODE.sh
test_expect_success 'mode change in one branch: keep changed version' '
: >file1 &&

View File

@ -5,7 +5,6 @@
test_description='Test export of commits to CVS'
. ./test-lib.sh
. "$TEST_DIRECTORY"/lib-prereq-FILEMODE.sh
if ! test_have_prereq PERL; then
skip_all='skipping git cvsexportcommit tests, perl not available'

View File

@ -830,6 +830,10 @@ test_lazy_prereq SYMLINKS '
ln -s x y && test -h y
'
test_lazy_prereq FILEMODE '
test "$(git config --bool core.filemode)" = true
'
test_lazy_prereq CASE_INSENSITIVE_FS '
echo good >CamelCase &&
echo bad >camelcase &&