From e9656473342e050494c8ea8416fdfdcf52fd1c93 Mon Sep 17 00:00:00 2001 From: Mark Levedahl Date: Mon, 7 Jul 2008 22:36:40 -0400 Subject: [PATCH] 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: Mark Levedahl Signed-off-by: Junio C Hamano --- git-submodule.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/git-submodule.sh b/git-submodule.sh index 3eb78cc72..099a7d756 100755 --- a/git-submodule.sh +++ b/git-submodule.sh @@ -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 -- 2.30.2