Skip to content

Commit 2b71b52

Browse files
Michael J Grubergitster
authored andcommitted
t0050: use the SYMLINKS test prereq
Signed-off-by: Michael J Gruber <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 9a3658b commit 2b71b52

File tree

1 file changed

+7
-14
lines changed

1 file changed

+7
-14
lines changed

t/t0050-filesystem.sh

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ auml=$(printf '\303\244')
88
aumlcdiar=$(printf '\141\314\210')
99

1010
unibad=
11-
no_symlinks=
1211
test_expect_success 'see what we expect' '
1312
1413
test_unicode=test_expect_success &&
@@ -21,13 +20,7 @@ test_expect_success 'see what we expect' '
2120
;;
2221
*) ;;
2322
esac &&
24-
rm -fr junk &&
25-
{
26-
ln -s x y 2> /dev/null &&
27-
test -h y 2> /dev/null ||
28-
no_symlinks=1 &&
29-
rm -f y
30-
}
23+
rm -fr junk
3124
'
3225

3326
if test_have_prereq CASE_INSENSITIVE_FS
@@ -40,7 +33,7 @@ fi
4033

4134
test "$unibad" &&
4235
say "will test on a unicode corrupting filesystem"
43-
test "$no_symlinks" &&
36+
test_have_prereq SYMLINKS ||
4437
say "will test on a filesystem lacking symbolic links"
4538

4639
if test_have_prereq CASE_INSENSITIVE_FS
@@ -57,18 +50,18 @@ test_expect_success "detection of case insensitive filesystem during repo init"
5750
'
5851
fi
5952

60-
if test "$no_symlinks"
53+
if test_have_prereq SYMLINKS
6154
then
6255
test_expect_success "detection of filesystem w/o symlink support during repo init" '
6356
64-
v=$(git config --bool core.symlinks) &&
65-
test "$v" = false
57+
test_must_fail git config --bool core.symlinks ||
58+
test "$(git config --bool core.symlinks)" = true
6659
'
6760
else
6861
test_expect_success "detection of filesystem w/o symlink support during repo init" '
6962
70-
test_must_fail git config --bool core.symlinks ||
71-
test "$(git config --bool core.symlinks)" = true
63+
v=$(git config --bool core.symlinks) &&
64+
test "$v" = false
7265
'
7366
fi
7467

0 commit comments

Comments
 (0)