| 1506 | } |
| 1507 | |
| 1508 | static void update_remote_info_refs(struct remote_lock *lock) |
| 1509 | { |
| 1510 | struct buffer buffer = { STRBUF_INIT, 0 }; |
| 1511 | struct active_request_slot *slot; |
| 1512 | struct slot_results results; |
| 1513 | struct curl_slist *dav_headers; |
| 1514 | |
| 1515 | remote_ls("refs/", (PROCESS_FILES | RECURSIVE), |
| 1516 | add_remote_info_ref, &buffer.buf); |
| 1517 | if (!aborted) { |
| 1518 | dav_headers = get_dav_token_headers(lock, DAV_HEADER_IF); |
| 1519 | |
| 1520 | slot = get_active_slot(); |
| 1521 | slot->results = &results; |
| 1522 | curl_setup_http(slot->curl, lock->url, DAV_PUT, |
| 1523 | &buffer, fwrite_null); |
| 1524 | curl_easy_setopt(slot->curl, CURLOPT_HTTPHEADER, dav_headers); |
| 1525 | |
| 1526 | if (start_active_slot(slot)) { |
| 1527 | run_active_slot(slot); |
| 1528 | if (results.curl_result != CURLE_OK) { |
| 1529 | fprintf(stderr, |
| 1530 | "PUT error: curl result=%d, HTTP code=%ld\n", |
| 1531 | results.curl_result, results.http_code); |
| 1532 | } |
| 1533 | } |
| 1534 | curl_slist_free_all(dav_headers); |
| 1535 | } |
| 1536 | strbuf_release(&buffer.buf); |
| 1537 | } |
| 1538 | |
| 1539 | static int remote_exists(const char *path) |
| 1540 | { |
no test coverage detected