MCPcopy Create free account
hub / github.com/git/git / fetch_bundle_uri

Function fetch_bundle_uri

bundle-uri.c:852–891  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

850}
851
852int fetch_bundle_uri(struct repository *r, const char *uri,
853 int *has_heuristic)
854{
855 int result;
856 struct bundle_list list;
857 struct remote_bundle_info bundle = {
858 .uri = xstrdup(uri),
859 .id = xstrdup(""),
860 };
861
862 trace2_region_enter("fetch", "fetch-bundle-uri", the_repository);
863
864 init_bundle_list(&list);
865
866 /*
867 * Do not fetch an empty bundle URI. An empty bundle URI
868 * could signal that a configured bundle URI has been disabled.
869 */
870 if (!*uri) {
871 result = 0;
872 goto cleanup;
873 }
874
875 /* If a bundle is added to this global list, then it is required. */
876 list.mode = BUNDLE_MODE_ALL;
877
878 if ((result = fetch_bundle_uri_internal(r, &bundle, 0, &list)))
879 goto cleanup;
880
881 result = unbundle_all_bundles(r, &list);
882
883cleanup:
884 if (has_heuristic)
885 *has_heuristic = (list.heuristic != BUNDLE_HEURISTIC_NONE);
886 for_all_bundles_in_list(&list, unlink_bundle, NULL);
887 clear_bundle_list(&list);
888 clear_remote_bundle_info(&bundle, NULL);
889 trace2_region_leave("fetch", "fetch-bundle-uri", the_repository);
890 return result;
891}
892
893int fetch_bundle_list(struct repository *r, struct bundle_list *list)
894{

Callers 2

cmd_fetchFunction · 0.85
cmd_cloneFunction · 0.85

Calls 7

xstrdupFunction · 0.85
init_bundle_listFunction · 0.85
unbundle_all_bundlesFunction · 0.85
for_all_bundles_in_listFunction · 0.85
clear_bundle_listFunction · 0.85
clear_remote_bundle_infoFunction · 0.85

Tested by

no test coverage detected