]>
Commit | Line | Data |
---|---|---|
78a8d641 JS |
1 | #!/bin/sh |
2 | # | |
3 | # Copyright (c) 2007 Johannes Sixt | |
4 | # | |
5 | ||
5be60078 | 6 | test_description='git checkout-index on filesystem w/o symlinks test. |
78a8d641 | 7 | |
5be60078 | 8 | This tests that git checkout-index creates a symbolic link as a plain |
78a8d641 JS |
9 | file if core.symlinks is false.' |
10 | ||
b7bcdbdb | 11 | TEST_PASSES_SANITIZE_LEAK=true |
78a8d641 JS |
12 | . ./test-lib.sh |
13 | ||
14 | test_expect_success \ | |
15 | 'preparation' ' | |
5be60078 | 16 | git config core.symlinks false && |
6ecfd91d | 17 | l=$(printf file | git hash-object -t blob -w --stdin) && |
5be60078 | 18 | echo "120000 $l symlink" | git update-index --index-info' |
78a8d641 JS |
19 | |
20 | test_expect_success \ | |
21 | 'the checked-out symlink must be a file' ' | |
5be60078 | 22 | git checkout-index symlink && |
78a8d641 JS |
23 | test -f symlink' |
24 | ||
4bd0785d ÆAB |
25 | test_expect_success 'the file must be the blob we added during the setup' ' |
26 | echo "$l" >expect && | |
27 | git hash-object -t blob symlink >actual && | |
28 | test_cmp expect actual | |
29 | ' | |
78a8d641 JS |
30 | |
31 | test_done |