http-push.c::fetch_symref(): use the new http API
Signed-off-by: Mike Hommey <mh@glandium.org> Signed-off-by: Tay Ray Chuan <rctay89@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Mike Hommey committed
Jun 6, 2009 at 16:43 UTC
9af5abd9939585bb588d537085138563922c6abe
1 file changed
+3
-17
http-push.c
+3
-17
@@ -2028,27 +2028,13 @@ static void fetch_symref(const char *path, char **symref, unsigned char *sha1)
2028
{
2029
char *url;
2030
struct strbuf buffer = STRBUF_INIT;
2031
- struct active_request_slot *slot;
2032
- struct slot_results results;
2031
2032
url = xmalloc(strlen(repo->url) + strlen(path) + 1);
2033
sprintf(url, "%s%s", repo->url, path);
2034
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);
2038
free(url);
2039
2040
free(*symref);