All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] git-submodule.sh: Always initialize $url variable
@ 2012-05-28  9:41 Nicolas Viennot and Sid Nair
  2012-05-28 19:46 ` [PATCH] submodules: print "registered for path" message only once Jens Lehmann
  0 siblings, 1 reply; 2+ messages in thread
From: Nicolas Viennot and Sid Nair @ 2012-05-28  9:41 UTC (permalink / raw)
  To: git, Junio C Hamano
  Cc: Nicolas Viennot and Sid Nair, Jens Lehmann, Ramsay Jones,
	Nicolas Viennot, Sid Nair

When git submodule init was called, the $url variable was not initialized
properly for submodules which have already been initialized. This led
to two problems.

First, when all of the submodules were initialized, each showed an empty url
instead of the actual url.

Second, when previously initialized submodules were printed after newly
added submodules, the displayed urls were incorrect.

Cc: Jens Lehmann <Jens.Lehmann@web.de>
Cc: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Nicolas Viennot <nicolas@viennot.biz>
Signed-off-by: Sid Nair <sidnair09@gmail.com>
---
 git-submodule.sh |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/git-submodule.sh b/git-submodule.sh
index 64a70d6..92fd6e2 100755
--- a/git-submodule.sh
+++ b/git-submodule.sh
@@ -396,11 +396,11 @@ cmd_init()
 	module_list "$@" |
 	while read mode sha1 stage sm_path
 	do
-		# Skip already registered paths
 		name=$(module_name "$sm_path") || exit
+		url=$(git config -f .gitmodules submodule."$name".url)
+		# Skip already registered paths
 		if test -z "$(git config "submodule.$name.url")"
 		then
-			url=$(git config -f .gitmodules submodule."$name".url)
 			test -z "$url" &&
 			die "$(eval_gettext "No url found for submodule path '\$sm_path' in .gitmodules")"
 
-- 
1.7.8.6

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-05-28 19:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-28  9:41 [PATCH] git-submodule.sh: Always initialize $url variable Nicolas Viennot and Sid Nair
2012-05-28 19:46 ` [PATCH] submodules: print "registered for path" message only once Jens Lehmann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.