aboutsummaryrefslogtreecommitdiff
path: root/bundle-uri.c
diff options
context:
space:
mode:
Diffstat (limited to 'bundle-uri.c')
-rw-r--r--bundle-uri.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/bundle-uri.c b/bundle-uri.c
index 57cccfc6b8..3b2e347288 100644
--- a/bundle-uri.c
+++ b/bundle-uri.c
@@ -89,7 +89,10 @@ static int summarize_bundle(struct remote_bundle_info *info, void *data)
{
FILE *fp = data;
fprintf(fp, "[bundle \"%s\"]\n", info->id);
- fprintf(fp, "\turi = %s\n", info->uri);
+ if (info->uri)
+ fprintf(fp, "\turi = %s\n", info->uri);
+ else
+ fprintf(fp, "\t# uri = (missing)\n");
if (info->creationToken)
fprintf(fp, "\tcreationToken = %"PRIu64"\n", info->creationToken);
@@ -267,6 +270,19 @@ int bundle_uri_parse_config_format(const char *uri,
result = 1;
}
+ if (!result) {
+ struct hashmap_iter iter;
+ struct remote_bundle_info *bundle;
+
+ hashmap_for_each_entry(&list->bundles, &iter, bundle, ent) {
+ if (!bundle->uri) {
+ error(_("bundle list at '%s': bundle '%s' has no uri"),
+ uri, bundle->id ? bundle->id : "<unknown>");
+ result = 1;
+ }
+ }
+ }
+
return result;
}
@@ -751,6 +767,12 @@ static int fetch_bundle_uri_internal(struct repository *r,
return -1;
}
+ if (!bundle->uri) {
+ error(_("bundle '%s' has no uri"),
+ bundle->id ? bundle->id : "<unknown>");
+ return -1;
+ }
+
if (!bundle->file &&
!(bundle->file = find_temp_filename())) {
result = -1;