The part of the test that is about symbolic links in the index does not
require that the corresponding file system entry is actually a symbolic
link. Use test_ln_s_add to insert a symbolic link in the index. When
the file system does not support symbolic links, we actually have a
regular file in the worktree, which we can update as if it were a
symbolic link. diff-index picks up the symbolic link property from the
index.
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
maint
Johannes Sixt12 years agocommitted byJunio C Hamano
test_expect_success SYMLINKS 'diff identical, but newly created symlink and file' '
test_expect_success 'diff identical, but newly created symlink and file' '
>expected &&
rm -f frotz nitfol &&
echo xyzzy >nitfol &&
test-chmtime +10 nitfol &&
ln -s xyzzy frotz &&
if test_have_prereq SYMLINKS
then
ln -s xyzzy frotz
else
printf xyzzy >frotz
# the symlink property propagates from the index
fi &&
git diff-index -M -p $tree >current &&
compare_diff_patch expected current &&
@ -80,7 +89,7 @@ test_expect_success SYMLINKS 'diff identical, but newly created symlink and file
@@ -80,7 +89,7 @@ test_expect_success SYMLINKS 'diff identical, but newly created symlink and file
compare_diff_patch expected current
'
test_expect_success SYMLINKS 'diff different symlink and file' '
test_expect_success 'diff different symlink and file' '
cat >expected <<-\EOF &&
diff --git a/frotz b/frotz
index 7c465af..df1db54 120000
@ -100,7 +109,13 @@ test_expect_success SYMLINKS 'diff different symlink and file' '
@@ -100,7 +109,13 @@ test_expect_success SYMLINKS 'diff different symlink and file' '