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