Add --depth to submodule update/add
Add the --depth option to the add and update commands of "git submodule", which is then passed on to the clone command. This is useful when the submodule(s) are huge and you're not really interested in anything but the latest commit. Tests are added and some indention adjustments were made to conform to the rest of the testfile on "submodule update can handle symbolic links in pwd". Signed-off-by: Fredrik Gustafsson <iveqy@iveqy.com> Acked-by: Jens Lehmann <Jens.Lehmann@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
edca415256
commit
275cd184d5
@ -868,4 +868,19 @@ test_expect_success 'submodule deinit fails when submodule has a .git directory
|
||||
test -n "$(git config --get-regexp "submodule\.example\.")"
|
||||
'
|
||||
|
||||
test_expect_success 'submodule add clone shallow submodule' '
|
||||
mkdir super &&
|
||||
pwd=$(pwd)
|
||||
(
|
||||
cd super &&
|
||||
git init &&
|
||||
git submodule add --depth=1 file://"$pwd"/example2 submodule &&
|
||||
(
|
||||
cd submodule &&
|
||||
test 1 = $(git log --oneline | wc -l)
|
||||
)
|
||||
)
|
||||
'
|
||||
|
||||
|
||||
test_done
|
||||
|
||||
Reference in New Issue
Block a user