summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2012-06-01 13:26:46 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2012-06-01 13:26:46 -0700
commit21e077fd4605bbd21ae996adc8aa5fb0700b9ed1 (patch)
treebb42ac96632ffc1829c0acf8ceec3b90f9b75b99
parentSync with maint (diff)
parentsubmodules: print "registered for path" message only once (diff)
downloadtgif-21e077fd4605bbd21ae996adc8aa5fb0700b9ed1.tar.xz
Merge branch 'jl/submodule-report-new-path-once'
"git submodule init" used to report "registered for path ..." even for submodules that were registered earlier. By Jens Lehmann * jl/submodule-report-new-path-once: submodules: print "registered for path" message only once
-rwxr-xr-xgit-submodule.sh7
1 files changed, 4 insertions, 3 deletions
diff --git a/git-submodule.sh b/git-submodule.sh
index 64a70d621a..5c61ae2b43 100755
--- a/git-submodule.sh
+++ b/git-submodule.sh
@@ -396,8 +396,9 @@ cmd_init()
module_list "$@" |
while read mode sha1 stage sm_path
do
- # Skip already registered paths
name=$(module_name "$sm_path") || exit
+
+ # Copy url setting when it is not set yet
if test -z "$(git config "submodule.$name.url")"
then
url=$(git config -f .gitmodules submodule."$name".url)
@@ -412,6 +413,8 @@ cmd_init()
esac
git config submodule."$name".url "$url" ||
die "$(eval_gettext "Failed to register url for submodule path '\$sm_path'")"
+
+ say "$(eval_gettext "Submodule '\$name' (\$url) registered for path '\$sm_path'")"
fi
# Copy "update" setting when it is not set yet
@@ -420,8 +423,6 @@ cmd_init()
test -n "$(git config submodule."$name".update)" ||
git config submodule."$name".update "$upd" ||
die "$(eval_gettext "Failed to register update mode for submodule path '\$sm_path'")"
-
- say "$(eval_gettext "Submodule '\$name' (\$url) registered for path '\$sm_path'")"
done
}