summaryrefslogtreecommitdiff
path: root/t/t7407-submodule-foreach.sh
diff options
context:
space:
mode:
authorLibravatar Johan Herland <johan@herland.net>2009-08-19 03:45:23 +0200
committerLibravatar Junio C Hamano <gitster@pobox.com>2009-08-18 22:59:12 -0700
commitb13fd5c1a2bd450cdf7b853e0c4861f361882a18 (patch)
tree018a5a1d768bc24e4a84c6ad32da32d202adf3df /t/t7407-submodule-foreach.sh
parentgit submodule foreach: Add --recursive to recurse into nested submodules (diff)
downloadtgif-b13fd5c1a2bd450cdf7b853e0c4861f361882a18.tar.xz
git submodule update: Introduce --recursive to update nested submodules
In very large and hierarchically structured projects, one may encounter nested submodules. In these situations, it is valuable to not only update the submodules in the current repo (which is what is currently done by 'git submodule update'), but also to operate on all submodules at all levels (i.e. recursing into nested submodules as well). This patch teaches the new --recursive option to the 'git submodule update' command. The patch also includes documentation and selftests. Signed-off-by: Johan Herland <johan@herland.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t7407-submodule-foreach.sh')
-rwxr-xr-xt/t7407-submodule-foreach.sh19
1 files changed, 19 insertions, 0 deletions
diff --git a/t/t7407-submodule-foreach.sh b/t/t7407-submodule-foreach.sh
index be122c7f8c..9122bfef35 100755
--- a/t/t7407-submodule-foreach.sh
+++ b/t/t7407-submodule-foreach.sh
@@ -175,4 +175,23 @@ test_expect_success 'test "foreach --quiet --recursive"' '
test_cmp expect actual
'
+test_expect_success 'use "update --recursive" to checkout all submodules' '
+ git clone super clone3 &&
+ (
+ cd clone3 &&
+ test ! -d sub1/.git &&
+ test ! -d sub2/.git &&
+ test ! -d sub3/.git &&
+ test ! -d nested1/.git &&
+ git submodule update --init --recursive &&
+ test -d sub1/.git &&
+ test -d sub2/.git &&
+ test -d sub3/.git &&
+ test -d nested1/.git &&
+ test -d nested1/nested2/.git &&
+ test -d nested1/nested2/nested3/.git &&
+ test -d nested1/nested2/nested3/submodule/.git
+ )
+'
+
test_done