]> git.ipfire.org Git - thirdparty/git.git/commit
http: use normalize_curl_result() instead of manual conversion
authorJeff King <peff@peff.net>
Sun, 24 Mar 2019 12:13:16 +0000 (08:13 -0400)
committerJunio C Hamano <gitster@pobox.com>
Sun, 24 Mar 2019 12:22:40 +0000 (21:22 +0900)
commit3d10f72ef8eaa229b285d39b4848aac41e5a8b02
tree80ebf8689a07f8668b4374eb41d98f5ba35ff8c6
parentccbbd8bf66ca88385a34b16abcc1d5a800650d3a
http: use normalize_curl_result() instead of manual conversion

When we switched off CURLOPT_FAILONERROR in 17966c0a63 (http: avoid
disconnecting on 404s for loose objects, 2016-07-11), the fetch_object()
function started manually handling 404's. Since we now have
normalize_curl_result() for use elsewhere, we can use it here as well,
shortening the code.

Note that we lose the check for http/https in the URL here. None of the
other result-normalizing code paths bother with this. Looking at
missing_target(), which checks specifically for an FTP-specific CURLcode
and "http" code 550, it seems likely that git-over-ftp has been subtly
broken since 17966c0a63. This patch does nothing to fix that, but nor
should it make anything worse (in fact, it may be slightly better
because we'll actually recognize an error as such, rather than assuming
CURLE_OK means we actually got some data).

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