t0050: use the SYMLINKS test prereq
Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Michael J Gruber committed
Jul 26, 2012 at 15:39 UTC
2b71b5221a66abd881919dd45609285e7af5c56f
1 file changed
+7
-14
t/t0050-filesystem.sh
+7
-14
@@ -8,7 +8,6 @@ auml=$(printf '\303\244')
8
aumlcdiar=$(printf '\141\314\210')
9
10
unibad=
11
-no_symlinks=
11
test_expect_success 'see what we expect' '
12
13
test_unicode=test_expect_success &&
@@ -21,13 +20,7 @@ test_expect_success 'see what we expect' '
20
;;
21
*) ;;
22
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
24
'
25
26
if test_have_prereq CASE_INSENSITIVE_FS
@@ -40,7 +33,7 @@ fi
33
34
test "$unibad" &&
35
say "will test on a unicode corrupting filesystem"
43
-test "$no_symlinks" &&
36
+test_have_prereq SYMLINKS ||
37
say "will test on a filesystem lacking symbolic links"
38
39
if test_have_prereq CASE_INSENSITIVE_FS
@@ -57,18 +50,18 @@ test_expect_success "detection of case insensitive filesystem during repo init"
50
'
51
fi
52
60
-if test "$no_symlinks"
53
+if test_have_prereq SYMLINKS
54
then
55
test_expect_success "detection of filesystem w/o symlink support during repo init" '
56
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
59
'
60
else
61
test_expect_success "detection of filesystem w/o symlink support during repo init" '
62
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
65
'
66
fi
67