diff options
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/clone.c | 7 | ||||
-rw-r--r-- | builtin/fetch.c | 6 | ||||
-rw-r--r-- | builtin/receive-pack.c | 13 |
3 files changed, 15 insertions, 11 deletions
diff --git a/builtin/clone.c b/builtin/clone.c index 31ea247e3f..32fe6060c3 100644 --- a/builtin/clone.c +++ b/builtin/clone.c @@ -624,10 +624,13 @@ static void update_remote_refs(const struct ref *refs, const struct ref *rm = mapped_refs; if (check_connectivity) { + struct check_connected_options opt = CHECK_CONNECTED_INIT; + + opt.transport = transport; + if (transport->progress) fprintf(stderr, _("Checking connectivity... ")); - if (check_everything_connected_with_transport(iterate_ref_map, - 0, &rm, transport)) + if (check_connected(iterate_ref_map, &rm, &opt)) die(_("remote did not send all necessary objects")); if (transport->progress) fprintf(stderr, _("done.\n")); diff --git a/builtin/fetch.c b/builtin/fetch.c index d9ea6f392a..75ee480099 100644 --- a/builtin/fetch.c +++ b/builtin/fetch.c @@ -729,7 +729,7 @@ static int store_updated_refs(const char *raw_url, const char *remote_name, url = xstrdup("foreign"); rm = ref_map; - if (check_everything_connected(iterate_ref_map, 0, &rm)) { + if (check_connected(iterate_ref_map, &rm, NULL)) { rc = error(_("%s did not send all necessary objects\n"), url); goto abort; } @@ -866,6 +866,7 @@ static int store_updated_refs(const char *raw_url, const char *remote_name, static int quickfetch(struct ref *ref_map) { struct ref *rm = ref_map; + struct check_connected_options opt = CHECK_CONNECTED_INIT; /* * If we are deepening a shallow clone we already have these @@ -876,7 +877,8 @@ static int quickfetch(struct ref *ref_map) */ if (depth) return -1; - return check_everything_connected(iterate_ref_map, 1, &rm); + opt.quiet = 1; + return check_connected(iterate_ref_map, &rm, &opt); } static int fetch_refs(struct transport *transport, struct ref *ref_map) diff --git a/builtin/receive-pack.c b/builtin/receive-pack.c index 15c323a7cd..ce819209a5 100644 --- a/builtin/receive-pack.c +++ b/builtin/receive-pack.c @@ -737,7 +737,7 @@ static int update_shallow_ref(struct command *cmd, struct shallow_info *si) { static struct lock_file shallow_lock; struct sha1_array extra = SHA1_ARRAY_INIT; - const char *alt_file; + struct check_connected_options opt = CHECK_CONNECTED_INIT; uint32_t mask = 1 << (cmd->index % 32); int i; @@ -749,9 +749,8 @@ static int update_shallow_ref(struct command *cmd, struct shallow_info *si) !delayed_reachability_test(si, i)) sha1_array_append(&extra, si->shallow->sha1[i]); - setup_alternate_shallow(&shallow_lock, &alt_file, &extra); - if (check_shallow_connected(command_singleton_iterator, - 0, cmd, alt_file)) { + setup_alternate_shallow(&shallow_lock, &opt.shallow_file, &extra); + if (check_connected(command_singleton_iterator, cmd, &opt)) { rollback_lock_file(&shallow_lock); sha1_array_clear(&extra); return -1; @@ -1160,8 +1159,8 @@ static void set_connectivity_errors(struct command *commands, if (shallow_update && si->shallow_ref[cmd->index]) /* to be checked in update_shallow_ref() */ continue; - if (!check_everything_connected(command_singleton_iterator, - 0, &singleton)) + if (!check_connected(command_singleton_iterator, &singleton, + NULL)) continue; cmd->error_string = "missing necessary objects"; } @@ -1330,7 +1329,7 @@ static void execute_commands(struct command *commands, data.cmds = commands; data.si = si; - if (check_everything_connected(iterate_receive_command_list, 0, &data)) + if (check_connected(iterate_receive_command_list, &data, NULL)) set_connectivity_errors(commands, si); reject_updates_to_hidden(commands); |