]> git.ipfire.org Git - thirdparty/git.git/commitdiff
http-push: prefer CURLOPT_UPLOAD to CURLOPT_PUT
authorJeff King <peff@peff.net>
Tue, 17 Jan 2023 03:04:38 +0000 (22:04 -0500)
committerJunio C Hamano <gitster@pobox.com>
Tue, 17 Jan 2023 16:03:07 +0000 (08:03 -0800)
The two options do exactly the same thing, but the latter has been
deprecated and in recent versions of curl may produce a compiler
warning. Since the UPLOAD form is available everywhere (it was
introduced in the year 2000 by curl 7.1), we can just switch to it.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
http-push.c

index 5f4340a36e6de404acaf4c447f6d8e60bc6f90ae..1b18e775d046e9a1484563ecb3cda0bdd8e9f5e4 100644 (file)
@@ -198,7 +198,7 @@ static void curl_setup_http(CURL *curl, const char *url,
                const char *custom_req, struct buffer *buffer,
                curl_write_callback write_fn)
 {
-       curl_easy_setopt(curl, CURLOPT_PUT, 1);
+       curl_easy_setopt(curl, CURLOPT_UPLOAD, 1);
        curl_easy_setopt(curl, CURLOPT_URL, url);
        curl_easy_setopt(curl, CURLOPT_INFILE, buffer);
        curl_easy_setopt(curl, CURLOPT_INFILESIZE, buffer->buf.len);