Merge branch 'sb/clone-shallow-passthru'

Fix an unintended regression in v2.9 that breaks "clone --depth"
that recurses down to submodules by forcing the submodules to also
be cloned shallowly, which many server instances that host upstream
of the submodules are not prepared for.

* sb/clone-shallow-passthru:
  clone: do not let --depth imply --shallow-submodules
This commit is contained in:
Junio C Hamano
2016-07-06 13:38:13 -07:00
3 changed files with 21 additions and 8 deletions

View File

@ -37,7 +37,22 @@ test_expect_success 'nonshallow clone implies nonshallow submodule' '
)
'
test_expect_success 'shallow clone implies shallow submodule' '
test_expect_success 'shallow clone with shallow submodule' '
test_when_finished "rm -rf super_clone" &&
git clone --recurse-submodules --depth 2 --shallow-submodules "file://$pwd/." super_clone &&
(
cd super_clone &&
git log --oneline >lines &&
test_line_count = 2 lines
) &&
(
cd super_clone/sub &&
git log --oneline >lines &&
test_line_count = 1 lines
)
'
test_expect_success 'shallow clone does not imply shallow submodule' '
test_when_finished "rm -rf super_clone" &&
git clone --recurse-submodules --depth 2 "file://$pwd/." super_clone &&
(
@ -48,7 +63,7 @@ test_expect_success 'shallow clone implies shallow submodule' '
(
cd super_clone/sub &&
git log --oneline >lines &&
test_line_count = 1 lines
test_line_count = 3 lines
)
'