tests: Move FILEMODE prerequisite to lib-prereq-FILEMODE.sh
Change the five tests that were all checking "git config --bool core.filemode" to use a new FILEMODE prerequisite in lib-prereq-FILEMODE.sh. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
617344d77b
commit
535d974285
11
t/lib-prereq-FILEMODE.sh
Normal file
11
t/lib-prereq-FILEMODE.sh
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
#!/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
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
test_description='add -i basic tests'
|
test_description='add -i basic tests'
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh
|
||||||
|
. "$TEST_DIRECTORY"/lib-prereq-FILEMODE.sh
|
||||||
|
|
||||||
if ! test_have_prereq PERL; then
|
if ! test_have_prereq PERL; then
|
||||||
skip_all='skipping git add -i tests, perl not available'
|
skip_all='skipping git add -i tests, perl not available'
|
||||||
@ -152,13 +153,6 @@ test_expect_success 'skip files similarly as commit -a' '
|
|||||||
'
|
'
|
||||||
rm -f .gitignore
|
rm -f .gitignore
|
||||||
|
|
||||||
if test "$(git config --bool core.filemode)" = false
|
|
||||||
then
|
|
||||||
say '# skipping filemode tests (filesystem does not properly support modes)'
|
|
||||||
else
|
|
||||||
test_set_prereq FILEMODE
|
|
||||||
fi
|
|
||||||
|
|
||||||
test_expect_success FILEMODE 'patch does not affect mode' '
|
test_expect_success FILEMODE 'patch does not affect mode' '
|
||||||
git reset --hard &&
|
git reset --hard &&
|
||||||
echo content >>file &&
|
echo content >>file &&
|
||||||
|
@ -7,6 +7,7 @@ test_description='git apply handling copy/rename patch.
|
|||||||
|
|
||||||
'
|
'
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh
|
||||||
|
. "$TEST_DIRECTORY"/lib-prereq-FILEMODE.sh
|
||||||
|
|
||||||
# setup
|
# setup
|
||||||
|
|
||||||
@ -31,13 +32,6 @@ test_expect_success setup \
|
|||||||
test_expect_success apply \
|
test_expect_success apply \
|
||||||
'git apply --index --stat --summary --apply test-patch'
|
'git apply --index --stat --summary --apply test-patch'
|
||||||
|
|
||||||
if test "$(git config --bool core.filemode)" = false
|
|
||||||
then
|
|
||||||
say 'filemode disabled on the filesystem'
|
|
||||||
else
|
|
||||||
test_set_prereq FILEMODE
|
|
||||||
fi
|
|
||||||
|
|
||||||
test_expect_success FILEMODE validate \
|
test_expect_success FILEMODE validate \
|
||||||
'test -f bar && ls -l bar | grep "^-..x......"'
|
'test -f bar && ls -l bar | grep "^-..x......"'
|
||||||
|
|
||||||
|
@ -3,13 +3,7 @@
|
|||||||
test_description='applying patch with mode bits'
|
test_description='applying patch with mode bits'
|
||||||
|
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh
|
||||||
|
. "$TEST_DIRECTORY"/lib-prereq-FILEMODE.sh
|
||||||
if test "$(git config --bool core.filemode)" = false
|
|
||||||
then
|
|
||||||
say 'filemode disabled on the filesystem'
|
|
||||||
else
|
|
||||||
test_set_prereq FILEMODE
|
|
||||||
fi
|
|
||||||
|
|
||||||
test_expect_success setup '
|
test_expect_success setup '
|
||||||
echo original >file &&
|
echo original >file &&
|
||||||
|
@ -2,11 +2,7 @@
|
|||||||
|
|
||||||
test_description='merge-recursive: handle file mode'
|
test_description='merge-recursive: handle file mode'
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh
|
||||||
|
. "$TEST_DIRECTORY"/lib-prereq-FILEMODE.sh
|
||||||
if ! test "$(git config --bool core.filemode)" = false
|
|
||||||
then
|
|
||||||
test_set_prereq FILEMODE
|
|
||||||
fi
|
|
||||||
|
|
||||||
test_expect_success 'mode change in one branch: keep changed version' '
|
test_expect_success 'mode change in one branch: keep changed version' '
|
||||||
: >file1 &&
|
: >file1 &&
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
test_description='Test export of commits to CVS'
|
test_description='Test export of commits to CVS'
|
||||||
|
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh
|
||||||
|
. "$TEST_DIRECTORY"/lib-prereq-FILEMODE.sh
|
||||||
|
|
||||||
if ! test_have_prereq PERL; then
|
if ! test_have_prereq PERL; then
|
||||||
skip_all='skipping git cvsexportcommit tests, perl not available'
|
skip_all='skipping git cvsexportcommit tests, perl not available'
|
||||||
@ -229,11 +230,6 @@ test_expect_success \
|
|||||||
test_must_fail git cvsexportcommit -c $id
|
test_must_fail git cvsexportcommit -c $id
|
||||||
)'
|
)'
|
||||||
|
|
||||||
if ! test "$(git config --bool core.filemode)" = false
|
|
||||||
then
|
|
||||||
test_set_prereq FILEMODE
|
|
||||||
fi
|
|
||||||
|
|
||||||
test_expect_success FILEMODE \
|
test_expect_success FILEMODE \
|
||||||
'Retain execute bit' \
|
'Retain execute bit' \
|
||||||
'mkdir G &&
|
'mkdir G &&
|
||||||
|
Loading…
Reference in New Issue
Block a user