summaryrefslogtreecommitdiff
path: root/t/t6035-merge-dir-to-symlink.sh
diff options
context:
space:
mode:
authorLibravatar Jeff King <peff@peff.net>2016-12-06 13:25:39 -0500
committerLibravatar Junio C Hamano <gitster@pobox.com>2016-12-06 12:43:34 -0800
commit3680f16f9d6832dc78c6b80f1e8a546385d946f9 (patch)
treef6a0743cd71fe03dce36e563ea2e02b2ae39a6b3 /t/t6035-merge-dir-to-symlink.sh
parentMerge branch 'ew/http-walker' into jk/http-walker-limit-redirect (diff)
downloadtgif-3680f16f9d6832dc78c6b80f1e8a546385d946f9.tar.xz
http-walker: complain about non-404 loose object errors
Since commit 17966c0a6 (http: avoid disconnecting on 404s for loose objects, 2016-07-11), we turn off curl's FAILONERROR option and instead manually deal with failing HTTP codes. However, the logic to do so only recognizes HTTP 404 as a failure. This is probably the most common result, but if we were to get another code, the curl result remains CURLE_OK, and we treat it as success. We still end up detecting the failure when we try to zlib-inflate the object (which will fail), but instead of reporting the HTTP error, we just claim that the object is corrupt. Instead, let's catch anything in the 300's or above as an error (300's are redirects which are not an error at the HTTP level, but are an indication that we've explicitly disabled redirects, so we should treat them as such; we certainly don't have the resulting object content). Note that we also fill in req->errorstr, which we didn't do before. Without FAILONERROR, curl will not have filled this in, and it will remain a blank string. This never mattered for the 404 case, because in the logic below we hit the "missing_target()" branch and print nothing. But for other errors, we'd want to say _something_, if only to fill in the blank slot in the error message. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t6035-merge-dir-to-symlink.sh')
0 files changed, 0 insertions, 0 deletions