summaryrefslogtreecommitdiff
path: root/t/t7400-submodule-basic.sh
diff options
context:
space:
mode:
authorFredrik Gustafsson <iveqy@iveqy.com>2013-07-02 21:42:56 (GMT)
committerJunio C Hamano <gitster@pobox.com>2013-07-03 17:33:32 (GMT)
commit275cd184d52b5b81cb89e4ec33e540fb2ae61c1f (patch)
treebbc8d455ea6b67d31c4c2079eada1e7dcf9d927f /t/t7400-submodule-basic.sh
parentedca4152560522a431a51fc0a06147fc680b5b18 (diff)
downloadgit-275cd184d52b5b81cb89e4ec33e540fb2ae61c1f.zip
git-275cd184d52b5b81cb89e4ec33e540fb2ae61c1f.tar.gz
git-275cd184d52b5b81cb89e4ec33e540fb2ae61c1f.tar.bz2
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>
Diffstat (limited to 't/t7400-submodule-basic.sh')
-rwxr-xr-xt/t7400-submodule-basic.sh15
1 files changed, 15 insertions, 0 deletions
diff --git a/t/t7400-submodule-basic.sh b/t/t7400-submodule-basic.sh
index ff26535..42cd6de 100755
--- a/t/t7400-submodule-basic.sh
+++ b/t/t7400-submodule-basic.sh
@@ -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