{"thread":{"id":"14335","subject":"[PATCH] git-submodule - Fix bugs in adding an existing repo as a module","startedAt":"2008-07-08T02:36:40Z","lastAt":"2008-07-08T02:36:40Z","messageCount":1,"participants":["Mark Levedahl"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"82525","messageId":"1215484600-2660-1-git-send-email-mlevedahl@gmail.com","threadId":"14335","inReplyTo":null,"subject":"[PATCH] git-submodule - Fix bugs in adding an existing repo as a module","fromName":"Mark Levedahl","fromEmail":"mlevedahl@gmail.com","sentAt":"2008-07-08T02:36:40Z","receivedAt":"2008-07-08T02:36:40Z","isPatch":true,"sender":{"key":"mdl123@verizon.net","avatar":"https://avatars.githubusercontent.com/u/5302462?v=4"},"body":"git-submodule add would trip if path to the submodule included a space,\nor if its .git was a gitdir: link to a GIT_DIR kept elsewhere. Fix both.\n\nSigned-off-by: Mark Levedahl <mlevedahl@gmail.com>\n---\n git-submodule.sh |    3 +--\n 1 files changed, 1 insertions(+), 2 deletions(-)\n\ndiff --git a/git-submodule.sh b/git-submodule.sh\nindex 3eb78cc..099a7d7 100755\n--- a/git-submodule.sh\n+++ b/git-submodule.sh\n@@ -167,8 +167,7 @@ cmd_add()\n \t# perhaps the path exists and is already a git repo, else clone it\n \tif test -e \"$path\"\n \tthen\n-\t\tif test -d \"$path/.git\" &&\n-\t\ttest \"$(unset GIT_DIR; cd $path; git rev-parse --git-dir)\" = \".git\"\n+\t\tif test -d \"$path\"/.git -o -f \"$path\"/.git\n \t\tthen\n \t\t\techo \"Adding existing repo at '$path' to the index\"\n \t\telse\n-- \n1.5.6.2.271.g73ad8\n"}]}