| 1430 | static struct ref *remote_refs; |
| 1431 | |
| 1432 | static void one_remote_ref(const char *refname) |
| 1433 | { |
| 1434 | struct ref *ref; |
| 1435 | struct object *obj; |
| 1436 | |
| 1437 | ref = alloc_ref(refname); |
| 1438 | |
| 1439 | if (http_fetch_ref(repo->url, ref) != 0) { |
| 1440 | fprintf(stderr, |
| 1441 | "Unable to fetch ref %s from %s\n", |
| 1442 | refname, repo->url); |
| 1443 | free(ref); |
| 1444 | return; |
| 1445 | } |
| 1446 | |
| 1447 | /* |
| 1448 | * Fetch a copy of the object if it doesn't exist locally - it |
| 1449 | * may be required for updating server info later. |
| 1450 | */ |
| 1451 | if (repo->can_update_info_refs && |
| 1452 | !odb_has_object(the_repository->objects, &ref->old_oid, |
| 1453 | ODB_HAS_OBJECT_RECHECK_PACKED | ODB_HAS_OBJECT_FETCH_PROMISOR)) { |
| 1454 | obj = lookup_unknown_object(the_repository, &ref->old_oid); |
| 1455 | fprintf(stderr, " fetch %s for %s\n", |
| 1456 | oid_to_hex(&ref->old_oid), refname); |
| 1457 | add_fetch_request(obj); |
| 1458 | } |
| 1459 | |
| 1460 | ref->next = remote_refs; |
| 1461 | remote_refs = ref; |
| 1462 | } |
| 1463 | |
| 1464 | static void get_dav_remote_heads(void) |
| 1465 | { |
no test coverage detected