submodule update: add convenience option --init
When a submodule is not initialized and you do not want to change the defaults from .gitmodules anyway, you can now say $ git submodule update --init <name> When "update" is called without --init on an uninitialized submodule, a hint to use --init is printed. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
b30317819d
commit
be4d2c83b6
@ -196,4 +196,17 @@ test_expect_success 'apply submodule diff' '
|
||||
test -z "$D"
|
||||
'
|
||||
|
||||
test_expect_success 'update --init' '
|
||||
|
||||
mv init init2 &&
|
||||
git config -f .gitmodules submodule.example.url "$(pwd)/init2" &&
|
||||
git config --remove-section submodule.example
|
||||
git submodule update init > update.out &&
|
||||
grep "not initialized" update.out &&
|
||||
test ! -d init/.git &&
|
||||
git submodule update --init init &&
|
||||
test -d init/.git
|
||||
|
||||
'
|
||||
|
||||
test_done
|
||||
|
Reference in New Issue
Block a user