2007-03-03 00:11:30 +03:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# Copyright (c) 2007 Johannes Sixt
|
|
|
|
#
|
|
|
|
|
2007-07-03 09:52:14 +04:00
|
|
|
test_description='git checkout-index on filesystem w/o symlinks test.
|
2007-03-03 00:11:30 +03:00
|
|
|
|
2007-07-03 09:52:14 +04:00
|
|
|
This tests that git checkout-index creates a symbolic link as a plain
|
2007-03-03 00:11:30 +03:00
|
|
|
file if core.symlinks is false.'
|
|
|
|
|
|
|
|
. ./test-lib.sh
|
|
|
|
|
|
|
|
test_expect_success \
|
|
|
|
'preparation' '
|
2007-07-03 09:52:14 +04:00
|
|
|
git config core.symlinks false &&
|
2008-10-31 08:09:13 +03:00
|
|
|
l=$(printf file | git hash-object -t blob -w --stdin) &&
|
2007-07-03 09:52:14 +04:00
|
|
|
echo "120000 $l symlink" | git update-index --index-info'
|
2007-03-03 00:11:30 +03:00
|
|
|
|
|
|
|
test_expect_success \
|
|
|
|
'the checked-out symlink must be a file' '
|
2007-07-03 09:52:14 +04:00
|
|
|
git checkout-index symlink &&
|
2007-03-03 00:11:30 +03:00
|
|
|
test -f symlink'
|
|
|
|
|
|
|
|
test_expect_success \
|
|
|
|
'the file must be the blob we added during the setup' '
|
2008-09-03 12:59:27 +04:00
|
|
|
test "$(git hash-object -t blob symlink)" = $l'
|
2007-03-03 00:11:30 +03:00
|
|
|
|
|
|
|
test_done
|