Skip to content

Commit

Permalink
test: make FILEMODE a lazy prereq
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jonathan Nieder authored and Junio C Hamano committed Nov 26, 2013
1 parent 30a3318 commit b018c73
Show file tree
Hide file tree
Showing 8 changed files with 4 additions and 17 deletions.
11 changes: 0 additions & 11 deletions t/lib-prereq-FILEMODE.sh

This file was deleted.

1 change: 0 additions & 1 deletion t/t3701-add-interactive.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion t/t4102-apply-rename.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ test_description='git apply handling copy/rename patch.
'
. ./test-lib.sh
. "$TEST_DIRECTORY"/lib-prereq-FILEMODE.sh

# setup

Expand Down
1 change: 0 additions & 1 deletion t/t4120-apply-popt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 &&
Expand Down
1 change: 0 additions & 1 deletion t/t4129-apply-samemode.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 &&
Expand Down
1 change: 0 additions & 1 deletion t/t6031-merge-recursive.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 &&
Expand Down
1 change: 0 additions & 1 deletion t/t9200-git-cvsexportcommit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
4 changes: 4 additions & 0 deletions t/test-lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 &&
Expand Down

0 comments on commit b018c73

Please sign in to comment.