From: Junio C Hamano Date: Thu, 18 Jul 2013 19:48:28 +0000 (-0700) Subject: Merge branch 'jk/maint-clone-shared-no-connectivity-validation' X-Git-Tag: v1.8.4-rc0~48 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/45ed4afabee57a2583f4b88828f598573f7cd239 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 --- 45ed4afabee57a2583f4b88828f598573f7cd239 diff --cc builtin/clone.c index 17f57cdf29,38a0a64c61..430307b298 --- a/builtin/clone.c +++ b/builtin/clone.c @@@ -545,17 -543,14 +545,20 @@@ static void update_remote_refs(const st 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 (check_everything_connected(iterate_ref_map, 0, &rm)) ++ 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 -953,7 +966,7 @@@ int cmd_clone(int argc, const char **ar 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, !is_local); ++ branch_top.buf, reflog_msg.buf, transport, !is_local); update_head(our_head_points_at, remote_head, reflog_msg.buf);