Skip to content

Commit 535d974

Browse files
avargitster
authored andcommitted
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>
1 parent 617344d commit 535d974

File tree

6 files changed

+16
-31
lines changed

6 files changed

+16
-31
lines changed

t/lib-prereq-FILEMODE.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
test_description='add -i basic tests'
44
. ./test-lib.sh
5+
. "$TEST_DIRECTORY"/lib-prereq-FILEMODE.sh
56

67
if ! test_have_prereq PERL; then
78
skip_all='skipping git add -i tests, perl not available'
@@ -152,13 +153,6 @@ test_expect_success 'skip files similarly as commit -a' '
152153
'
153154
rm -f .gitignore
154155

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-
162156
test_expect_success FILEMODE 'patch does not affect mode' '
163157
git reset --hard &&
164158
echo content >>file &&

t/t4102-apply-rename.sh

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ test_description='git apply handling copy/rename patch.
77
88
'
99
. ./test-lib.sh
10+
. "$TEST_DIRECTORY"/lib-prereq-FILEMODE.sh
1011

1112
# setup
1213

@@ -31,13 +32,6 @@ test_expect_success setup \
3132
test_expect_success apply \
3233
'git apply --index --stat --summary --apply test-patch'
3334

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-
4135
test_expect_success FILEMODE validate \
4236
'test -f bar && ls -l bar | grep "^-..x......"'
4337

t/t4129-apply-samemode.sh

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,7 @@
33
test_description='applying patch with mode bits'
44

55
. ./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
137

148
test_expect_success setup '
159
echo original >file &&

t/t6031-merge-recursive.sh

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,7 @@
22

33
test_description='merge-recursive: handle file mode'
44
. ./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
106

117
test_expect_success 'mode change in one branch: keep changed version' '
128
: >file1 &&

t/t9200-git-cvsexportcommit.sh

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
test_description='Test export of commits to CVS'
66

77
. ./test-lib.sh
8+
. "$TEST_DIRECTORY"/lib-prereq-FILEMODE.sh
89

910
if ! test_have_prereq PERL; then
1011
skip_all='skipping git cvsexportcommit tests, perl not available'
@@ -229,11 +230,6 @@ test_expect_success \
229230
test_must_fail git cvsexportcommit -c $id
230231
)'
231232

232-
if ! test "$(git config --bool core.filemode)" = false
233-
then
234-
test_set_prereq FILEMODE
235-
fi
236-
237233
test_expect_success FILEMODE \
238234
'Retain execute bit' \
239235
'mkdir G &&

0 commit comments

Comments
 (0)