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:
Johannes Schindelin
2008-05-16 11:23:03 +01:00
committed by Junio C Hamano
parent b30317819d
commit be4d2c83b6
3 changed files with 25 additions and 2 deletions

View File

@ -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