From 535d9742852e12a4d4cfc878eb2e734df70a8f22 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Fri, 13 Aug 2010 20:40:04 +0000 Subject: [PATCH] tests: Move FILEMODE prerequisite to lib-prereq-FILEMODE.sh MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Junio C Hamano --- t/lib-prereq-FILEMODE.sh | 11 +++++++++++ t/t3701-add-interactive.sh | 8 +------- t/t4102-apply-rename.sh | 8 +------- t/t4129-apply-samemode.sh | 8 +------- t/t6031-merge-recursive.sh | 6 +----- t/t9200-git-cvsexportcommit.sh | 6 +----- 6 files changed, 16 insertions(+), 31 deletions(-) create mode 100644 t/lib-prereq-FILEMODE.sh diff --git a/t/lib-prereq-FILEMODE.sh b/t/lib-prereq-FILEMODE.sh new file mode 100644 index 000000000..bce5a4c8b --- /dev/null +++ b/t/lib-prereq-FILEMODE.sh @@ -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 diff --git a/t/t3701-add-interactive.sh b/t/t3701-add-interactive.sh index 7ad8465f8..75ec90bde 100755 --- a/t/t3701-add-interactive.sh +++ b/t/t3701-add-interactive.sh @@ -2,6 +2,7 @@ test_description='add -i basic tests' . ./test-lib.sh +. "$TEST_DIRECTORY"/lib-prereq-FILEMODE.sh if ! test_have_prereq PERL; then 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 -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' ' git reset --hard && echo content >>file && diff --git a/t/t4102-apply-rename.sh b/t/t4102-apply-rename.sh index 159796524..e3ea3d511 100755 --- a/t/t4102-apply-rename.sh +++ b/t/t4102-apply-rename.sh @@ -7,6 +7,7 @@ test_description='git apply handling copy/rename patch. ' . ./test-lib.sh +. "$TEST_DIRECTORY"/lib-prereq-FILEMODE.sh # setup @@ -31,13 +32,6 @@ test_expect_success setup \ test_expect_success apply \ '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 -f bar && ls -l bar | grep "^-..x......"' diff --git a/t/t4129-apply-samemode.sh b/t/t4129-apply-samemode.sh index fc7af0493..0d36ebdc8 100755 --- a/t/t4129-apply-samemode.sh +++ b/t/t4129-apply-samemode.sh @@ -3,13 +3,7 @@ test_description='applying patch with mode bits' . ./test-lib.sh - -if test "$(git config --bool core.filemode)" = false -then - say 'filemode disabled on the filesystem' -else - test_set_prereq FILEMODE -fi +. "$TEST_DIRECTORY"/lib-prereq-FILEMODE.sh test_expect_success setup ' echo original >file && diff --git a/t/t6031-merge-recursive.sh b/t/t6031-merge-recursive.sh index 8a3304fb0..66167e3f7 100755 --- a/t/t6031-merge-recursive.sh +++ b/t/t6031-merge-recursive.sh @@ -2,11 +2,7 @@ test_description='merge-recursive: handle file mode' . ./test-lib.sh - -if ! test "$(git config --bool core.filemode)" = false -then - test_set_prereq FILEMODE -fi +. "$TEST_DIRECTORY"/lib-prereq-FILEMODE.sh test_expect_success 'mode change in one branch: keep changed version' ' : >file1 && diff --git a/t/t9200-git-cvsexportcommit.sh b/t/t9200-git-cvsexportcommit.sh index ee39b36d7..e5da65b99 100755 --- a/t/t9200-git-cvsexportcommit.sh +++ b/t/t9200-git-cvsexportcommit.sh @@ -5,6 +5,7 @@ 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' @@ -229,11 +230,6 @@ test_expect_success \ 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 \ 'Retain execute bit' \ 'mkdir G && -- 2.30.2