diff options
author | Junio C Hamano <gitster@pobox.com> | 2013-06-06 12:17:55 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-06-06 12:17:55 -0700 |
commit | 72e719292d5dd6e037fecbc3a1c5e4d4f21f03b8 (patch) | |
tree | 239f589cfc197cc5fb839ace54e244dc9dc5f632 /builtin/clone.c | |
parent | 9d54f97e34a92d1504f24a5896e9741111f38d79 (diff) | |
parent | c6807a40dcd29f7e5ad1e2f4fc44f1729c9afa11 (diff) | |
download | git-72e719292d5dd6e037fecbc3a1c5e4d4f21f03b8.tar.gz git-72e719292d5dd6e037fecbc3a1c5e4d4f21f03b8.tar.xz |
Merge branch 'nd/clone-connectivity-shortcut'
Special case "git clone" and use lighter-weight implementation to
check the completeness of the history behind refs.
* nd/clone-connectivity-shortcut:
clone: open a shortcut for connectivity check
index-pack: remove dead code (it should never happen)
fetch-pack: prepare updated shallow file before fetching the pack
clone: let the user know when check_everything_connected is run
Diffstat (limited to 'builtin/clone.c')
-rw-r--r-- | builtin/clone.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/builtin/clone.c b/builtin/clone.c index b6ffc6b4f..66bff5700 100644 --- a/builtin/clone.c +++ b/builtin/clone.c @@ -541,12 +541,18 @@ static void update_remote_refs(const struct ref *refs, const struct ref *mapped_refs, const struct ref *remote_head_points_at, const char *branch_top, - const char *msg) + const char *msg, + struct transport *transport) { const struct ref *rm = mapped_refs; - 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); @@ -890,6 +896,9 @@ int cmd_clone(int argc, const char **argv, const char *prefix) if (option_upload_pack) transport_set_option(transport, TRANS_OPT_UPLOADPACK, option_upload_pack); + + if (transport->smart_options && !option_depth) + transport->smart_options->check_self_contained_and_connected = 1; } refs = transport_get_remote_refs(transport); @@ -951,7 +960,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); + branch_top.buf, reflog_msg.buf, transport); update_head(our_head_points_at, remote_head, reflog_msg.buf); |