summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2013-07-18 12:48:28 -0700
committerJunio C Hamano <gitster@pobox.com>2013-07-18 12:48:29 -0700
commit45ed4afabee57a2583f4b88828f598573f7cd239 (patch)
tree58e0e700bdc32f5d9840a78a07217771c95f5726
parentdb1a848421fe05482e36fcba76f019299ae93b25 (diff)
parent125a05fd0b45416558923b753f6418c24208d443 (diff)
downloadgit-45ed4afabee57a2583f4b88828f598573f7cd239.tar.gz
Merge branch 'jk/maint-clone-shared-no-connectivity-validation'
"git clone -s/-l" is a filesystem level copy and does not offer any protection against source repository being corrupt. While the connectivity validation checks commits and trees being readable, it made the otherwise instantaneous local modes of clone much more expensive, without protecting blob data from bitflips. * jk/maint-clone-shared-no-connectivity-validation: clone: drop connectivity check for local clones
-rw-r--r--builtin/clone.c21
-rwxr-xr-xt/t5710-info-alternate.sh8
2 files changed, 19 insertions, 10 deletions
diff --git a/builtin/clone.c b/builtin/clone.c
index 17f57cdf29..430307b298 100644
--- a/builtin/clone.c
+++ b/builtin/clone.c
@@ -545,17 +545,20 @@ static void update_remote_refs(const struct ref *refs,
const struct ref *remote_head_points_at,
const char *branch_top,
const char *msg,
- struct transport *transport)
+ struct transport *transport,
+ int check_connectivity)
{
const struct ref *rm = mapped_refs;
- if (0 <= option_verbosity)
- printf(_("Checking connectivity... "));
- if (check_everything_connected_with_transport(iterate_ref_map,
- 0, &rm, transport))
- die(_("remote did not send all necessary objects"));
- if (0 <= option_verbosity)
- printf(_("done\n"));
+ if (check_connectivity) {
+ if (0 <= option_verbosity)
+ printf(_("Checking connectivity... "));
+ if (check_everything_connected_with_transport(iterate_ref_map,
+ 0, &rm, transport))
+ die(_("remote did not send all necessary objects"));
+ if (0 <= option_verbosity)
+ printf(_("done\n"));
+ }
if (refs) {
write_remote_refs(mapped_refs);
@@ -963,7 +966,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
transport_fetch_refs(transport, mapped_refs);
update_remote_refs(refs, mapped_refs, remote_head_points_at,
- branch_top.buf, reflog_msg.buf, transport);
+ branch_top.buf, reflog_msg.buf, transport, !is_local);
update_head(our_head_points_at, remote_head, reflog_msg.buf);
diff --git a/t/t5710-info-alternate.sh b/t/t5710-info-alternate.sh
index 8956c21617..5a6e49d18d 100755
--- a/t/t5710-info-alternate.sh
+++ b/t/t5710-info-alternate.sh
@@ -58,7 +58,13 @@ test_expect_success 'creating too deep nesting' \
git clone -l -s D E &&
git clone -l -s E F &&
git clone -l -s F G &&
-test_must_fail git clone --bare -l -s G H'
+git clone --bare -l -s G H'
+
+test_expect_success 'invalidity of deepest repository' \
+'cd H && {
+ test_valid_repo
+ test $? -ne 0
+}'
cd "$base_dir"