Skip to content

Commit

Permalink
Merge branch 'jl/submodule-report-new-path-once'
Browse files Browse the repository at this point in the history
"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
  • Loading branch information
Junio C Hamano committed Jun 1, 2012
2 parents 2c4888e + c1c259e commit 21e077f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions git-submodule.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand All @@ -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
}

Expand Down

0 comments on commit 21e077f

Please sign in to comment.