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