@matheusbsbs / matheus-bagliano / commits / 0b9dca434f
Fork 0

submodule sync: Update "submodule.<name>.url"

When "git submodule sync" synchronizes the repository URLs it only updates submodules' .git/config. However, the old URLs still exist in the super-project's .git/config. Update the super-project's configuration so that commands such as "git submodule update" use the URLs from .gitmodules. Signed-off-by: David Aguilar <davvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

David Aguilar committed Aug 18, 2010 at 08:58 UTC 0b9dca434f5d9208a26f47f7ec11453f1cfdfae8
2 files changed +5 -1
git-submodule.sh
+2 -1
@@ -839,10 +839,11 @@ cmd_sync()
839 if test -e "$path"/.git
840 then
841 (
842 + say "Synchronizing submodule url for '$name'"
843 + git config submodule."$name".url "$url"
844 clear_local_git_env
845 cd "$path"
846 remote=$(get_default_remote)
845 - say "Synchronizing submodule url for '$name'"
847 git config remote."$remote".url "$url"
848 )
849 fi
t/t7403-submodule-sync.sh
+3
@@ -58,6 +58,9 @@ test_expect_success '"git submodule sync" should update submodule URLs' '
58 (cd super-clone/submodule &&
59 git checkout master &&
60 git pull
61 + ) &&
62 + (cd super-clone &&
63 + test -d "$(git config submodule.submodule.url)"
64 )
65 '
66