Skip to content

Commit

Permalink
submodule sync: Update "submodule.<name>.url"
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
David Aguilar authored and Junio C Hamano committed Aug 18, 2010
1 parent 64fdc08 commit 0b9dca4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion git-submodule.sh
Original file line number Diff line number Diff line change
Expand Up @@ -839,10 +839,11 @@ cmd_sync()
if test -e "$path"/.git
then
(
say "Synchronizing submodule url for '$name'"
git config submodule."$name".url "$url"
clear_local_git_env
cd "$path"
remote=$(get_default_remote)
say "Synchronizing submodule url for '$name'"
git config remote."$remote".url "$url"
)
fi
Expand Down
3 changes: 3 additions & 0 deletions t/t7403-submodule-sync.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ test_expect_success '"git submodule sync" should update submodule URLs' '
(cd super-clone/submodule &&
git checkout master &&
git pull
) &&
(cd super-clone &&
test -d "$(git config submodule.submodule.url)"
)
'

Expand Down

0 comments on commit 0b9dca4

Please sign in to comment.