summaryrefslogtreecommitdiff
path: root/remote-curl.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2013-04-05 18:21:34 -0400
committerJunio C Hamano <gitster@pobox.com>2013-04-06 18:56:44 -0700
commit67d2a7b5c502496b0c5acd25a5e0ffa766b61745 (patch)
treed3f222a51f9a56905428dd7bab1c36b9d0d33016 /remote-curl.c
parentd5ccbe4dfb43d95d1d04252490fcd200e6aa5759 (diff)
downloadgit-67d2a7b5c502496b0c5acd25a5e0ffa766b61745.tar.gz
http: simplify http_error helper function
This helper function should really be a one-liner that prints an error message, but it has ended up unnecessarily complicated: 1. We call error() directly when we fail to start the curl request, so we must later avoid printing a duplicate error in http_error(). It would be much simpler in this case to just stuff the error message into our usual curl_errorstr buffer rather than printing it ourselves. This means that http_error does not even have to care about curl's exit value (the interesting part is in the errorstr buffer already). 2. We return the "ret" value passed in to us, but none of the callers actually cares about our return value. We can just drop this entirely. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'remote-curl.c')
-rw-r--r--remote-curl.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/remote-curl.c b/remote-curl.c
index 6c6714b00a..9abe4b7116 100644
--- a/remote-curl.c
+++ b/remote-curl.c
@@ -216,7 +216,7 @@ static struct discovery* discover_refs(const char *service, int for_push)
die("Authentication failed for '%s'", url);
default:
show_http_message(&type, &buffer);
- http_error(url, http_ret);
+ http_error(url);
die("HTTP request failed");
}