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