Skip to content

Commit 9af5abd

Browse files
glandiumgitster
authored andcommitted
http-push.c::fetch_symref(): use the new http API
Signed-off-by: Mike Hommey <[email protected]> Signed-off-by: Tay Ray Chuan <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 446b941 commit 9af5abd

File tree

1 file changed

+3
-17
lines changed

1 file changed

+3
-17
lines changed

http-push.c

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2028,27 +2028,13 @@ static void fetch_symref(const char *path, char **symref, unsigned char *sha1)
20282028
{
20292029
char *url;
20302030
struct strbuf buffer = STRBUF_INIT;
2031-
struct active_request_slot *slot;
2032-
struct slot_results results;
20332031

20342032
url = xmalloc(strlen(repo->url) + strlen(path) + 1);
20352033
sprintf(url, "%s%s", repo->url, path);
20362034

2037-
slot = get_active_slot();
2038-
slot->results = &results;
2039-
curl_easy_setopt(slot->curl, CURLOPT_FILE, &buffer);
2040-
curl_easy_setopt(slot->curl, CURLOPT_WRITEFUNCTION, fwrite_buffer);
2041-
curl_easy_setopt(slot->curl, CURLOPT_HTTPHEADER, NULL);
2042-
curl_easy_setopt(slot->curl, CURLOPT_URL, url);
2043-
if (start_active_slot(slot)) {
2044-
run_active_slot(slot);
2045-
if (results.curl_result != CURLE_OK) {
2046-
die("Couldn't get %s for remote symref\n%s",
2047-
url, curl_errorstr);
2048-
}
2049-
} else {
2050-
die("Unable to start remote symref request");
2051-
}
2035+
if (http_get_strbuf(url, &buffer, 0) != HTTP_OK)
2036+
die("Couldn't get %s for remote symref\n%s", url,
2037+
curl_errorstr);
20522038
free(url);
20532039

20542040
free(*symref);

0 commit comments

Comments
 (0)