Skip to content

Commit

Permalink
git-submodule - Fix bugs in adding an existing repo as a module
Browse files Browse the repository at this point in the history
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 <mlevedahl@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Mark Levedahl authored and Junio C Hamano committed Jul 8, 2008
1 parent d773c63 commit e965647
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions git-submodule.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e965647

Please sign in to comment.