Merge branch 'ak/submodule-sync' into maint
* ak/submodule-sync: submodule sync: Update "submodule.<name>.url" for empty directories
This commit is contained in:
commit
a274f5b21d
@ -836,11 +836,12 @@ cmd_sync()
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
say "Synchronizing submodule url for '$name'"
|
||||||
|
git config submodule."$name".url "$url"
|
||||||
|
|
||||||
if test -e "$path"/.git
|
if test -e "$path"/.git
|
||||||
then
|
then
|
||||||
(
|
(
|
||||||
say "Synchronizing submodule url for '$name'"
|
|
||||||
git config submodule."$name".url "$url"
|
|
||||||
clear_local_git_env
|
clear_local_git_env
|
||||||
cd "$path"
|
cd "$path"
|
||||||
remote=$(get_default_remote)
|
remote=$(get_default_remote)
|
||||||
|
@ -23,7 +23,9 @@ test_expect_success setup '
|
|||||||
git commit -m "submodule"
|
git commit -m "submodule"
|
||||||
) &&
|
) &&
|
||||||
git clone super super-clone &&
|
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' '
|
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
|
test_done
|
||||||
|
Loading…
Reference in New Issue
Block a user