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>
Ævar Arnfjörð Bjarmason committed
Aug 13, 2010 at 20:40 UTC
535d9742852e12a4d4cfc878eb2e734df70a8f22
6 files changed
+16
-31
t/lib-prereq-FILEMODE.sh
new
+11
@@ -0,0 +1,11 @@
1
+#!/bin/sh
2
+#
3
+# Copyright (c) 2010 Ævar Arnfjörð Bjarmason
4
+#
5
+
6
+if test "$(git config --bool core.filemode)" = false
7
+then
8
+ say 'filemode disabled on the filesystem'
9
+else
10
+ test_set_prereq FILEMODE
11
+fi
t/t3701-add-interactive.sh
+1
-7
@@ -2,6 +2,7 @@
2
3
test_description='add -i basic tests'
4
. ./test-lib.sh
5
+. "$TEST_DIRECTORY"/lib-prereq-FILEMODE.sh
6
7
if ! test_have_prereq PERL; then
8
skip_all='skipping git add -i tests, perl not available'
@@ -152,13 +153,6 @@ test_expect_success 'skip files similarly as commit -a' '
153
'
154
rm -f .gitignore
155
155
-if test "$(git config --bool core.filemode)" = false
156
-then
157
- say '# skipping filemode tests (filesystem does not properly support modes)'
158
-else
159
- test_set_prereq FILEMODE
160
-fi
161
-
156
test_expect_success FILEMODE 'patch does not affect mode' '
157
git reset --hard &&
158
echo content >>file &&
t/t4102-apply-rename.sh
+1
-7
@@ -7,6 +7,7 @@ test_description='git apply handling copy/rename patch.
7
8
'
9
. ./test-lib.sh
10
+. "$TEST_DIRECTORY"/lib-prereq-FILEMODE.sh
11
12
# setup
13
@@ -31,13 +32,6 @@ test_expect_success setup \
32
test_expect_success apply \
33
'git apply --index --stat --summary --apply test-patch'
34
34
-if test "$(git config --bool core.filemode)" = false
35
-then
36
- say 'filemode disabled on the filesystem'
37
-else
38
- test_set_prereq FILEMODE
39
-fi
40
-
35
test_expect_success FILEMODE validate \
36
'test -f bar && ls -l bar | grep "^-..x......"'
37
t/t4129-apply-samemode.sh
+1
-7
@@ -3,13 +3,7 @@
3
test_description='applying patch with mode bits'
4
5
. ./test-lib.sh
6
-
7
-if test "$(git config --bool core.filemode)" = false
8
-then
9
- say 'filemode disabled on the filesystem'
10
-else
11
- test_set_prereq FILEMODE
12
-fi
6
+. "$TEST_DIRECTORY"/lib-prereq-FILEMODE.sh
7
8
test_expect_success setup '
9
echo original >file &&
t/t6031-merge-recursive.sh
+1
-5
@@ -2,11 +2,7 @@
2
3
test_description='merge-recursive: handle file mode'
4
. ./test-lib.sh
5
-
6
-if ! test "$(git config --bool core.filemode)" = false
7
-then
8
- test_set_prereq FILEMODE
9
-fi
5
+. "$TEST_DIRECTORY"/lib-prereq-FILEMODE.sh
6
7
test_expect_success 'mode change in one branch: keep changed version' '
8
: >file1 &&
t/t9200-git-cvsexportcommit.sh
+1
-5
@@ -5,6 +5,7 @@
5
test_description='Test export of commits to CVS'
6
7
. ./test-lib.sh
8
+. "$TEST_DIRECTORY"/lib-prereq-FILEMODE.sh
9
10
if ! test_have_prereq PERL; then
11
skip_all='skipping git cvsexportcommit tests, perl not available'
@@ -229,11 +230,6 @@ test_expect_success \
230
test_must_fail git cvsexportcommit -c $id
231
)'
232
232
-if ! test "$(git config --bool core.filemode)" = false
233
-then
234
- test_set_prereq FILEMODE
235
-fi
236
-
233
test_expect_success FILEMODE \
234
'Retain execute bit' \
235
'mkdir G &&