@@ -561,6 +561,27 @@ cleanup:
return result;
}
+int fetch_bundle_list(struct repository *r, const char *uri, struct bundle_list *list)
+{
+ int result;
+ struct bundle_list global_list;
+
+ init_bundle_list(&global_list);
+
+ /* If a bundle is added to this global list, then it is required. */
+ global_list.mode = BUNDLE_MODE_ALL;
+
+ if ((result = download_bundle_list(r, list, &global_list, 0)))
+ goto cleanup;
+
+ result = unbundle_all_bundles(r, &global_list);
+
+cleanup:
+ for_all_bundles_in_list(&global_list, unlink_bundle, NULL);
+ clear_bundle_list(&global_list);
+ return result;
+}
+
/**
* API for serve.c.
*/
@@ -107,6 +107,17 @@ int parse_bundle_list_in_config_format(const char *uri,
*/
int fetch_bundle_uri(struct repository *r, const char *uri);
+/**
+ * Given a bundle list that was already advertised (likely by the
+ * bundle-uri protocol v2 verb) at the given uri, fetch and unbundle the
+ * bundles according to the bundle strategy of that list.
+ *
+ * Returns non-zero if no bundle information is found at the given 'uri'.
+ */
+int fetch_bundle_list(struct repository *r,
+ const char *uri,
+ struct bundle_list *list);
+
/**
* API for serve.c.
*/