提交 e9656473 编写于 作者: M Mark Levedahl 提交者: Junio C Hamano

git-submodule - Fix bugs in adding an existing repo as a module

git-submodule add would trip if path to the submodule included a space,
or if its .git was a gitdir: link to a GIT_DIR kept elsewhere. Fix both.
Signed-off-by: NMark Levedahl <mlevedahl@gmail.com>
Signed-off-by: NJunio C Hamano <gitster@pobox.com>
上级 d773c631
......@@ -167,8 +167,7 @@ cmd_add()
# perhaps the path exists and is already a git repo, else clone it
if test -e "$path"
then
if test -d "$path/.git" &&
test "$(unset GIT_DIR; cd $path; git rev-parse --git-dir)" = ".git"
if test -d "$path"/.git -o -f "$path"/.git
then
echo "Adding existing repo at '$path' to the index"
else
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册