mirror of
https://github.com/git/git
synced 2024-08-27 11:39:22 +00:00
![Brian Gernhardt](/assets/img/avatar_default.png)
Expecting echo to recognise -n is a BSDism. Using printf is far more portable. Discovered on OS X 10.5.5 in t4030-diff-textconv.sh and changed in all the test scripts. Signed-off-by: Brian Gernhardt <benji@silverinsanity.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
32 lines
802 B
Bash
Executable file
32 lines
802 B
Bash
Executable file
#!/bin/sh
|
|
#
|
|
# Copyright (c) 2007 Johannes Sixt
|
|
#
|
|
|
|
test_description='git update-index on filesystem w/o symlinks test.
|
|
|
|
This tests that git update-index keeps the symbolic link property
|
|
even if a plain file is in the working tree if core.symlinks is false.'
|
|
|
|
. ./test-lib.sh
|
|
|
|
test_expect_success \
|
|
'preparation' '
|
|
git config core.symlinks false &&
|
|
l=$(printf file | git hash-object -t blob -w --stdin) &&
|
|
echo "120000 $l symlink" | git update-index --index-info'
|
|
|
|
test_expect_success \
|
|
'modify the symbolic link' '
|
|
printf new-file > symlink &&
|
|
git update-index symlink'
|
|
|
|
test_expect_success \
|
|
'the index entry must still be a symbolic link' '
|
|
case "`git ls-files --stage --cached symlink`" in
|
|
120000" "*symlink) echo ok;;
|
|
*) echo fail; git ls-files --stage --cached symlink; (exit 1);;
|
|
esac'
|
|
|
|
test_done
|