提交 8a785dc9 编写于 作者: J Junio C Hamano

Add tests to catch problems with un-unlinkable symlinks

This currently fails not because we refuse to check out, but because we
detect error but incorrectly discard it in the callchain.
Signed-off-by: NJunio C Hamano <gitster@pobox.com>
上级 8d14ac94
......@@ -157,6 +157,41 @@ test_expect_success '3-way not overwriting local changes (their side)' '
'
test_expect_success 'funny symlink in work tree' '
git reset --hard &&
git checkout -b sym-b side-b &&
mkdir -p a &&
>a/b &&
git add a/b &&
git commit -m "side adds a/b" &&
rm -fr a &&
git checkout -b sym-a side-a &&
mkdir -p a &&
ln -s ../b a/b &&
git add a/b &&
git commit -m "we add a/b" &&
git read-tree -m -u sym-a sym-a sym-b
'
test_expect_failure 'funny symlink in work tree, un-unlink-able' '
rm -fr a b &&
git reset --hard &&
git checkout sym-a &&
chmod a-w a &&
test_must_fail git read-tree -m -u sym-a sym-a sym-b
'
# clean-up from the above test
chmod a+w a
rm -fr a b
test_expect_success 'D/F setup' '
git reset --hard &&
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册