Replace a pair of patches with updated ones for subproject support.
[git/jnareb-git/bp-gitweb.git] / t / t2102-update-index-symlinks.sh
blob969ef891d3152106e192e84595c0de9b1010cd4b
1 #!/bin/sh
3 # Copyright (c) 2007 Johannes Sixt
6 test_description='git-update-index on filesystem w/o symlinks test.
8 This tests that git-update-index keeps the symbolic link property
9 even if a plain file is in the working tree if core.symlinks is false.'
11 . ./test-lib.sh
13 test_expect_success \
14 'preparation' '
15 git-config core.symlinks false &&
16 l=$(echo -n file | git-hash-object -t blob -w --stdin) &&
17 echo "120000 $l symlink" | git-update-index --index-info'
19 test_expect_success \
20 'modify the symbolic link' '
21 echo -n new-file > symlink &&
22 git-update-index symlink'
24 test_expect_success \
25 'the index entry must still be a symbolic link' '
26 case "`git-ls-files --stage --cached symlink`" in
27 120000" "*symlink) echo ok;;
28 *) echo fail; git-ls-files --stage --cached symlink; (exit 1);;
29 esac'
31 test_done