submodule sync: Update "submodule.<name>.url"
PATCH 1/1 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.
--- git-submodule.sh | 3 ++- t/t7403-submodule-sync.sh | 3 +++ 2 files changed, 5 insertions(+), 1 deletions(-)
git-submodule.sh +2 -1
@@ -840,9 +840,10 @@ cmd_sync() then ( clear_local_git_env + say "Synchronizing submodule url for '$name'" + git config submodule."$name".url "$url" cd "$path" remote=$(get_default_remote) - say "Synchronizing submodule url for '$name'" git config remote."$remote".url "$url" ) fi
t/t7403-submodule-sync.sh +3 -0
@@ -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)" ) '
Signature · 1 line
1.7.2.1.97.g3235b.dirty
Am 8/18/2010 12:01, schrieb David Aguilar:
git-submodule.sh cmd_sync() · line 844
Quoted 6 lines
git-submodule.sh +2
-0@@ -840,9 +840,10 @@ cmd_sync() then ( clear_local_git_env + say "Synchronizing submodule url for '$name'" + git config submodule."$name".url "$url"
This git config applies to the super module, right? As such, shouldn't it happen before you clear_local_git_env?
git-submodule.sh cmd_sync() · line 848
Quoted 5 lines
git-submodule.sh +0
-1cd "$path" remote=$(get_default_remote) - say "Synchronizing submodule url for '$name'" git config remote."$remote".url "$url" )
-- Hannes
PATCH v2 1/1 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.
---
Changes since v1:
We now call clear_local_git_env after configuring the super project (thanks Johannes).
git-submodule.sh | 3 ++- t/t7403-submodule-sync.sh | 3 +++ 2 files changed, 5 insertions(+), 1 deletions(-)
git-submodule.sh +2 -1
@@ -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
t/t7403-submodule-sync.sh +3 -0
@@ -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)" ) '
Signature · 1 line
1.7.2.1.97.g3235b
Quoted 10 lines · Johannes Sixt
Am 8/18/2010 12:01, schrieb David Aguilar:
git-submodule.sh cmd_sync() · line 844
Quoted 6 lines
git-submodule.sh +2
-0@@ -840,9 +840,10 @@ cmd_sync() then ( clear_local_git_env + say "Synchronizing submodule url for '$name'" + git config submodule."$name".url "$url"This git config applies to the super module, right? As such, shouldn't it happen before you
clear_local_git_env?
Good catch, thanks. I'll resend.
Quoted 8 lines
git-submodule.sh cmd_sync() · line 848
Quoted 6 lines
git-submodule.sh +0
-1cd "$path" remote=$(get_default_remote) - say "Synchronizing submodule url for '$name'" git config remote."$remote".url "$url" )-- Hannes
Signature · 1 line
David