提交 8196e728 编写于 作者: P Patrick Steinhardt 提交者: Junio C Hamano

git-submodule.sh: fix '/././' path normalization

When we add a new submodule the path of the submodule is being
normalized. We fail to normalize multiple adjacent '/./', though.
Thus 'path/to/././submodule' will become 'path/to/./submodule' where
it should be 'path/to/submodule' instead.
Signed-off-by: NPatrick Steinhardt <ps@pks.im>
Acked-by: NJens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: NJunio C Hamano <gitster@pobox.com>
上级 3d8a54eb
......@@ -420,7 +420,7 @@ cmd_add()
sed -e '
s|//*|/|g
s|^\(\./\)*||
s|/\./|/|g
s|/\(\./\)*|/|g
:start
s|\([^/]*\)/\.\./||
tstart
......
......@@ -171,6 +171,23 @@ test_expect_success 'submodule add with ./ in path' '
test_cmp empty untracked
'
test_expect_success 'submodule add with /././ in path' '
echo "refs/heads/master" >expect &&
>empty &&
(
cd addtest &&
git submodule add "$submodurl" dotslashdotsubmod/././frotz/./ &&
git submodule init
) &&
rm -f heads head untracked &&
inspect addtest/dotslashdotsubmod/frotz ../../.. &&
test_cmp expect heads &&
test_cmp expect head &&
test_cmp empty untracked
'
test_expect_success 'submodule add with // in path' '
echo "refs/heads/master" >expect &&
>empty &&
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册