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>
This commit is contained in:
Michael J Gruber 2012-07-26 15:39:55 +02:00 committed by Junio C Hamano
parent 9a3658b977
commit 2b71b5221a

View file

@ -8,7 +8,6 @@ auml=$(printf '\303\244')
aumlcdiar=$(printf '\141\314\210') aumlcdiar=$(printf '\141\314\210')
unibad= unibad=
no_symlinks=
test_expect_success 'see what we expect' ' test_expect_success 'see what we expect' '
test_unicode=test_expect_success && test_unicode=test_expect_success &&
@ -21,13 +20,7 @@ test_expect_success 'see what we expect' '
;; ;;
*) ;; *) ;;
esac && esac &&
rm -fr junk && rm -fr junk
{
ln -s x y 2> /dev/null &&
test -h y 2> /dev/null ||
no_symlinks=1 &&
rm -f y
}
' '
if test_have_prereq CASE_INSENSITIVE_FS if test_have_prereq CASE_INSENSITIVE_FS
@ -40,7 +33,7 @@ fi
test "$unibad" && test "$unibad" &&
say "will test on a unicode corrupting filesystem" say "will test on a unicode corrupting filesystem"
test "$no_symlinks" && test_have_prereq SYMLINKS ||
say "will test on a filesystem lacking symbolic links" say "will test on a filesystem lacking symbolic links"
if test_have_prereq CASE_INSENSITIVE_FS if test_have_prereq CASE_INSENSITIVE_FS
@ -57,19 +50,19 @@ test_expect_success "detection of case insensitive filesystem during repo init"
' '
fi fi
if test "$no_symlinks" if test_have_prereq SYMLINKS
then then
test_expect_success "detection of filesystem w/o symlink support during repo init" '
v=$(git config --bool core.symlinks) &&
test "$v" = false
'
else
test_expect_success "detection of filesystem w/o symlink support during repo init" ' test_expect_success "detection of filesystem w/o symlink support during repo init" '
test_must_fail git config --bool core.symlinks || test_must_fail git config --bool core.symlinks ||
test "$(git config --bool core.symlinks)" = true test "$(git config --bool core.symlinks)" = true
' '
else
test_expect_success "detection of filesystem w/o symlink support during repo init" '
v=$(git config --bool core.symlinks) &&
test "$v" = false
'
fi fi
test_expect_success "setup case tests" ' test_expect_success "setup case tests" '