summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-06-20 11:01:01 -0700
committerJunio C Hamano <gitster@pobox.com>2016-06-20 11:01:01 -0700
commit3807098cd6abf4b94b6e0326255e5f5f0577f975 (patch)
tree34d2bb8e5c9ae4f9409c2cfdd6206ec32a5ff5d0 /t
parentde76eb69d2359f4820b120e49be9a30067bb5d3b (diff)
parentabed000acafd8aa86e02bcbb65fc1a8e4f06b8a0 (diff)
downloadgit-3807098cd6abf4b94b6e0326255e5f5f0577f975.tar.gz
Merge branch 'sb/submodule-recommend-shallowness'
An upstream project can make a recommendation to shallowly clone some submodules in the .gitmodules file it ships. * sb/submodule-recommend-shallowness: submodule update: learn `--[no-]recommend-shallow` option submodule-config: keep shallow recommendation around
Diffstat (limited to 't')
-rwxr-xr-xt/t5614-clone-submodules.sh52
1 files changed, 52 insertions, 0 deletions
diff --git a/t/t5614-clone-submodules.sh b/t/t5614-clone-submodules.sh
index 62044c5a02..32d83e2694 100755
--- a/t/t5614-clone-submodules.sh
+++ b/t/t5614-clone-submodules.sh
@@ -82,4 +82,56 @@ test_expect_success 'non shallow clone with shallow submodule' '
)
'
+test_expect_success 'clone follows shallow recommendation' '
+ test_when_finished "rm -rf super_clone" &&
+ git config -f .gitmodules submodule.sub.shallow true &&
+ git add .gitmodules &&
+ git commit -m "recommed shallow for sub" &&
+ git clone --recurse-submodules --no-local "file://$pwd/." super_clone &&
+ (
+ cd super_clone &&
+ git log --oneline >lines &&
+ test_line_count = 4 lines
+ ) &&
+ (
+ cd super_clone/sub &&
+ git log --oneline >lines &&
+ test_line_count = 1 lines
+ )
+'
+
+test_expect_success 'get unshallow recommended shallow submodule' '
+ test_when_finished "rm -rf super_clone" &&
+ git clone --no-local "file://$pwd/." super_clone &&
+ (
+ cd super_clone &&
+ git submodule update --init --no-recommend-shallow &&
+ git log --oneline >lines &&
+ test_line_count = 4 lines
+ ) &&
+ (
+ cd super_clone/sub &&
+ git log --oneline >lines &&
+ test_line_count = 3 lines
+ )
+'
+
+test_expect_success 'clone follows non shallow recommendation' '
+ test_when_finished "rm -rf super_clone" &&
+ git config -f .gitmodules submodule.sub.shallow false &&
+ git add .gitmodules &&
+ git commit -m "recommed non shallow for sub" &&
+ git clone --recurse-submodules --no-local "file://$pwd/." super_clone &&
+ (
+ cd super_clone &&
+ git log --oneline >lines &&
+ test_line_count = 5 lines
+ ) &&
+ (
+ cd super_clone/sub &&
+ git log --oneline >lines &&
+ test_line_count = 3 lines
+ )
+'
+
test_done