Johannes Sixt | 78a8d64 | 2007-03-02 22:11:30 +0100 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | # |
| 3 | # Copyright (c) 2007 Johannes Sixt |
| 4 | # |
| 5 | |
Junio C Hamano | 5be6007 | 2007-07-02 22:52:14 -0700 | [diff] [blame] | 6 | test_description='git checkout-index on filesystem w/o symlinks test. |
Johannes Sixt | 78a8d64 | 2007-03-02 22:11:30 +0100 | [diff] [blame] | 7 | |
Junio C Hamano | 5be6007 | 2007-07-02 22:52:14 -0700 | [diff] [blame] | 8 | This tests that git checkout-index creates a symbolic link as a plain |
Johannes Sixt | 78a8d64 | 2007-03-02 22:11:30 +0100 | [diff] [blame] | 9 | file if core.symlinks is false.' |
| 10 | |
| 11 | . ./test-lib.sh |
| 12 | |
| 13 | test_expect_success \ |
| 14 | 'preparation' ' |
Junio C Hamano | 5be6007 | 2007-07-02 22:52:14 -0700 | [diff] [blame] | 15 | git config core.symlinks false && |
Brian Gernhardt | 6ecfd91 | 2008-10-31 01:09:13 -0400 | [diff] [blame] | 16 | l=$(printf file | git hash-object -t blob -w --stdin) && |
Junio C Hamano | 5be6007 | 2007-07-02 22:52:14 -0700 | [diff] [blame] | 17 | echo "120000 $l symlink" | git update-index --index-info' |
Johannes Sixt | 78a8d64 | 2007-03-02 22:11:30 +0100 | [diff] [blame] | 18 | |
| 19 | test_expect_success \ |
| 20 | 'the checked-out symlink must be a file' ' |
Junio C Hamano | 5be6007 | 2007-07-02 22:52:14 -0700 | [diff] [blame] | 21 | git checkout-index symlink && |
Johannes Sixt | 78a8d64 | 2007-03-02 22:11:30 +0100 | [diff] [blame] | 22 | test -f symlink' |
| 23 | |
| 24 | test_expect_success \ |
| 25 | 'the file must be the blob we added during the setup' ' |
Nanako Shiraishi | 0cb0e14 | 2008-09-03 17:59:27 +0900 | [diff] [blame] | 26 | test "$(git hash-object -t blob symlink)" = $l' |
Johannes Sixt | 78a8d64 | 2007-03-02 22:11:30 +0100 | [diff] [blame] | 27 | |
| 28 | test_done |