| 850 | } |
| 851 | |
| 852 | int 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 | |
| 883 | cleanup: |
| 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 | |
| 893 | int fetch_bundle_list(struct repository *r, struct bundle_list *list) |
| 894 | { |
no test coverage detected