Skip to content

Commit

Permalink
t0050: use the SYMLINKS test prereq
Browse files Browse the repository at this point in the history
Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Michael J Gruber authored and Junio C Hamano committed Jul 27, 2012
1 parent 9a3658b commit 2b71b52
Showing 1 changed file with 7 additions and 14 deletions.
21 changes: 7 additions & 14 deletions t/t0050-filesystem.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ auml=$(printf '\303\244')
aumlcdiar=$(printf '\141\314\210')

unibad=
no_symlinks=
test_expect_success 'see what we expect' '
test_unicode=test_expect_success &&
Expand All @@ -21,13 +20,7 @@ test_expect_success 'see what we expect' '
;;
*) ;;
esac &&
rm -fr junk &&
{
ln -s x y 2> /dev/null &&
test -h y 2> /dev/null ||
no_symlinks=1 &&
rm -f y
}
rm -fr junk
'

if test_have_prereq CASE_INSENSITIVE_FS
Expand All @@ -40,7 +33,7 @@ fi

test "$unibad" &&
say "will test on a unicode corrupting filesystem"
test "$no_symlinks" &&
test_have_prereq SYMLINKS ||
say "will test on a filesystem lacking symbolic links"

if test_have_prereq CASE_INSENSITIVE_FS
Expand All @@ -57,18 +50,18 @@ test_expect_success "detection of case insensitive filesystem during repo init"
'
fi

if test "$no_symlinks"
if test_have_prereq SYMLINKS
then
test_expect_success "detection of filesystem w/o symlink support during repo init" '
v=$(git config --bool core.symlinks) &&
test "$v" = false
test_must_fail git config --bool core.symlinks ||
test "$(git config --bool core.symlinks)" = true
'
else
test_expect_success "detection of filesystem w/o symlink support during repo init" '
test_must_fail git config --bool core.symlinks ||
test "$(git config --bool core.symlinks)" = true
v=$(git config --bool core.symlinks) &&
test "$v" = false
'
fi

Expand Down

0 comments on commit 2b71b52

Please sign in to comment.