]> git.ipfire.org Git - thirdparty/git.git/blame_incremental - t/t2005-checkout-index-symlinks.sh
The eighth batch
[thirdparty/git.git] / t / t2005-checkout-index-symlinks.sh
... / ...
CommitLineData
1#!/bin/sh
2#
3# Copyright (c) 2007 Johannes Sixt
4#
5
6test_description='git checkout-index on filesystem w/o symlinks test.
7
8This tests that git checkout-index creates a symbolic link as a plain
9file if core.symlinks is false.'
10
11TEST_PASSES_SANITIZE_LEAK=true
12. ./test-lib.sh
13
14test_expect_success \
15'preparation' '
16git config core.symlinks false &&
17l=$(printf file | git hash-object -t blob -w --stdin) &&
18echo "120000 $l symlink" | git update-index --index-info'
19
20test_expect_success \
21'the checked-out symlink must be a file' '
22git checkout-index symlink &&
23test -f symlink'
24
25test_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'
30
31test_done