summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ec05df3)
raw | patch | inline | side by side (parent: ec05df3)
author | Mark Levedahl <mlevedahl@gmail.com> | |
Thu, 10 Jul 2008 01:05:41 +0000 (21:05 -0400) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Tue, 15 Jul 2008 06:35:32 +0000 (23:35 -0700) |
When adding a new submodule in place, meaning the user created the
submodule as a git repo in the superproject's tree first, we don't go
through "git submodule init" to register the module. Thus, the
submodule's origin repository URL is not stored in .git/config, and no
subsequent submodule operation will ever do so. In this case, assume the
URL the user supplies to "submodule add" is the one that should be
registered, and do so.
Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
submodule as a git repo in the superproject's tree first, we don't go
through "git submodule init" to register the module. Thus, the
submodule's origin repository URL is not stored in .git/config, and no
subsequent submodule operation will ever do so. In this case, assume the
URL the user supplies to "submodule add" is the one that should be
registered, and do so.
Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-submodule.sh | patch | blob | history |
diff --git a/git-submodule.sh b/git-submodule.sh
index c2ce2fbe8afa924f7f34970a3fb07363abe07452..9228f56bee7fd82d530a6865f1f8669fd9b99d8f 100755 (executable)
--- a/git-submodule.sh
+++ b/git-submodule.sh
else
die "'$path' already exists and is not a valid git repo"
fi
+
+ case "$repo" in
+ ./*|../*)
+ url=$(resolve_relative_url "$repo") || exit
+ ;;
+ *)
+ url="$repo"
+ ;;
+ esac
+ git config submodule."$path".url "$url"
else
module_clone "$path" "$realrepo" || exit