diff options
Diffstat (limited to 'promisor-remote.c')
-rw-r--r-- | promisor-remote.c | 36 |
1 files changed, 23 insertions, 13 deletions
diff --git a/promisor-remote.c b/promisor-remote.c index 5b33f88..ac3aa1e 100644 --- a/promisor-remote.c +++ b/promisor-remote.c @@ -1,9 +1,13 @@ -#include "cache.h" -#include "object-store.h" +#include "git-compat-util.h" +#include "gettext.h" +#include "hex.h" +#include "object-store-ll.h" #include "promisor-remote.h" #include "config.h" +#include "trace2.h" #include "transport.h" #include "strvec.h" +#include "packfile.h" struct promisor_remote_config { struct promisor_remote *promisors; @@ -96,7 +100,9 @@ static void promisor_remote_move_to_tail(struct promisor_remote_config *config, config->promisors_tail = &r->next; } -static int promisor_remote_config(const char *var, const char *value, void *data) +static int promisor_remote_config(const char *var, const char *value, + const struct config_context *ctx UNUSED, + void *data) { struct promisor_remote_config *config = data; const char *name; @@ -146,7 +152,7 @@ static void promisor_remote_init(struct repository *r) if (r->promisor_remote_config) return; config = r->promisor_remote_config = - xcalloc(sizeof(*r->promisor_remote_config), 1); + xcalloc(1, sizeof(*r->promisor_remote_config)); config->promisors_tail = &config->promisors; repo_config(r, promisor_remote_config, config); @@ -230,18 +236,18 @@ static int remove_fetched_oids(struct repository *repo, return remaining_nr; } -int promisor_remote_get_direct(struct repository *repo, - const struct object_id *oids, - int oid_nr) +void promisor_remote_get_direct(struct repository *repo, + const struct object_id *oids, + int oid_nr) { struct promisor_remote *r; struct object_id *remaining_oids = (struct object_id *)oids; int remaining_nr = oid_nr; int to_free = 0; - int res = -1; + int i; if (oid_nr == 0) - return 0; + return; promisor_remote_init(repo); @@ -256,12 +262,16 @@ int promisor_remote_get_direct(struct repository *repo, continue; } } - res = 0; - break; + goto all_fetched; } + for (i = 0; i < remaining_nr; i++) { + if (is_promisor_object(&remaining_oids[i])) + die(_("could not fetch %s from promisor remote"), + oid_to_hex(&remaining_oids[i])); + } + +all_fetched: if (to_free) free(remaining_oids); - - return res; } |