Skip to content

Commit 21e077f

Browse files
committed
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
2 parents 2c4888e + c1c259e commit 21e077f

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

git-submodule.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -396,8 +396,9 @@ cmd_init()
396396
module_list "$@" |
397397
while read mode sha1 stage sm_path
398398
do
399-
# Skip already registered paths
400399
name=$(module_name "$sm_path") || exit
400+
401+
# Copy url setting when it is not set yet
401402
if test -z "$(git config "submodule.$name.url")"
402403
then
403404
url=$(git config -f .gitmodules submodule."$name".url)
@@ -412,6 +413,8 @@ cmd_init()
412413
esac
413414
git config submodule."$name".url "$url" ||
414415
die "$(eval_gettext "Failed to register url for submodule path '\$sm_path'")"
416+
417+
say "$(eval_gettext "Submodule '\$name' (\$url) registered for path '\$sm_path'")"
415418
fi
416419

417420
# Copy "update" setting when it is not set yet
@@ -420,8 +423,6 @@ cmd_init()
420423
test -n "$(git config submodule."$name".update)" ||
421424
git config submodule."$name".update "$upd" ||
422425
die "$(eval_gettext "Failed to register update mode for submodule path '\$sm_path'")"
423-
424-
say "$(eval_gettext "Submodule '\$name' (\$url) registered for path '\$sm_path'")"
425426
done
426427
}
427428

0 commit comments

Comments
 (0)