summaryrefslogtreecommitdiff
path: root/t/t5601-clone.sh
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2013-12-05 13:02:53 (GMT)
committerJunio C Hamano <gitster@pobox.com>2013-12-11 00:14:18 (GMT)
commit0d7d285f0e29abb994fe32db87ee81b00f403bd2 (patch)
treed4faea61b13c73cdd418cdcdc1f4323fe2b1a414 /t/t5601-clone.sh
parentf2c681cf12c54ce3859b36693f8a13c36126577b (diff)
downloadgit-0d7d285f0e29abb994fe32db87ee81b00f403bd2.zip
git-0d7d285f0e29abb994fe32db87ee81b00f403bd2.tar.gz
git-0d7d285f0e29abb994fe32db87ee81b00f403bd2.tar.bz2
clone: use git protocol for cloning shallow repo locally
clone_local() does not handle $SRC/shallow. It could be made so, but it's simpler to use fetch-pack/upload-pack instead. This used to be caught by the check in upload-pack, which is triggered by transport_get_remote_refs(), even in local clone case. The check is now gone and check_everything_connected() should catch the result incomplete repo. But check_everything_connected() will soon be skipped in local clone case, opening a door to corrupt repo. This patch should close that door. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5601-clone.sh')
-rwxr-xr-xt/t5601-clone.sh7
1 files changed, 7 insertions, 0 deletions
diff --git a/t/t5601-clone.sh b/t/t5601-clone.sh
index 1d1c875..c226cff 100755
--- a/t/t5601-clone.sh
+++ b/t/t5601-clone.sh
@@ -340,4 +340,11 @@ test_expect_success 'clone from a repository with two identical branches' '
'
+test_expect_success 'shallow clone locally' '
+ git clone --depth=1 --no-local src ssrrcc &&
+ git clone ssrrcc ddsstt &&
+ test_cmp ssrrcc/.git/shallow ddsstt/.git/shallow &&
+ ( cd ddsstt && git fsck )
+'
+
test_done