diff options
| author | Junio C Hamano <gitster@pobox.com> | 2010-11-17 14:59:54 -0800 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2010-11-17 14:59:54 -0800 |
| commit | 734e0ba43767ebb73bb35a921c0a38e956f0b4d1 (patch) | |
| tree | 1a42b8de15fe36255d67a0ed67bb8de531b5e65d | |
| parent | Merge branch 'jk/maint-rev-list-nul' (diff) | |
| parent | submodule sync: Update "submodule.<name>.url" for empty directories (diff) | |
| download | git-734e0ba43767ebb73bb35a921c0a38e956f0b4d1.tar.gz git-734e0ba43767ebb73bb35a921c0a38e956f0b4d1.zip | |
Merge branch 'ak/submodule-sync'
* ak/submodule-sync:
submodule sync: Update "submodule.<name>.url" for empty directories
| -rwxr-xr-x | git-submodule.sh | 5 | ||||
| -rwxr-xr-x | t/t7403-submodule-sync.sh | 12 |
2 files changed, 14 insertions, 3 deletions
diff --git a/git-submodule.sh b/git-submodule.sh index 9ebbab798d..c291eed59c 100755 --- a/git-submodule.sh +++ b/git-submodule.sh @@ -836,11 +836,12 @@ cmd_sync() ;; esac + say "Synchronizing submodule url for '$name'" + git config submodule."$name".url "$url" + 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) diff --git a/t/t7403-submodule-sync.sh b/t/t7403-submodule-sync.sh index 02522f9627..e5b19538b0 100755 --- a/t/t7403-submodule-sync.sh +++ b/t/t7403-submodule-sync.sh @@ -23,7 +23,9 @@ test_expect_success setup ' git commit -m "submodule" ) && git clone super super-clone && - (cd super-clone && git submodule update --init) + (cd super-clone && git submodule update --init) && + git clone super empty-clone && + (cd empty-clone && git submodule init) ' test_expect_success 'change submodule' ' @@ -64,4 +66,12 @@ test_expect_success '"git submodule sync" should update submodule URLs' ' ) ' +test_expect_success '"git submodule sync" should update submodule URLs if not yet cloned' ' + (cd empty-clone && + git pull && + git submodule sync && + test -d "$(git config submodule.submodule.url)" + ) +' + test_done |
