| 1537 | } |
| 1538 | |
| 1539 | static int remote_exists(const char *path) |
| 1540 | { |
| 1541 | char *url = xstrfmt("%s%s", repo->url, path); |
| 1542 | int ret; |
| 1543 | |
| 1544 | |
| 1545 | switch (http_get_strbuf(url, NULL, NULL)) { |
| 1546 | case HTTP_OK: |
| 1547 | ret = 1; |
| 1548 | break; |
| 1549 | case HTTP_MISSING_TARGET: |
| 1550 | ret = 0; |
| 1551 | break; |
| 1552 | case HTTP_ERROR: |
| 1553 | error("unable to access '%s': %s", url, curl_errorstr); |
| 1554 | /* fallthrough */ |
| 1555 | default: |
| 1556 | ret = -1; |
| 1557 | } |
| 1558 | free(url); |
| 1559 | return ret; |
| 1560 | } |
| 1561 | |
| 1562 | static void fetch_symref(const char *path, char **symref, struct object_id *oid) |
| 1563 | { |
no test coverage detected