From: Nicolas Viennot and Sid Nair Date: Mon, 28 May 2012 09:41:54 GMT Subject: [PATCH] git-submodule.sh: Always initialize $url variable Message-ID: <1338198114-20480-1-git-send-email-nviennot+sidnair@viennot.biz> 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 Cc: Ramsay Jones Signed-off-by: Nicolas Viennot Signed-off-by: Sid Nair --- 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