summaryrefslogtreecommitdiff
path: root/http-fetch.c
diff options
context:
space:
mode:
authorPetr Baudis <pasky@suse.cz>2005-10-21 18:18:46 +0200
committerJunio C Hamano <junkio@cox.net>2005-10-23 11:49:25 -0700
commite2029eb963bab6efeff48a7e1ded93842a257717 (patch)
tree6d8755bf4c40ac448c9bfb6f70e2b0c43dbcef67 /http-fetch.c
parent8ac3a61f59173d4a9a328518be83a25df610a5ef (diff)
downloadgit-e2029eb963bab6efeff48a7e1ded93842a257717.tar.gz
Silence confusing and false-positive curl error message
git-http-fetch spits out curl 404 error message when unable to fetch an object, but that's confusing since no error really happened and the object is usually found in a pack it tries right after that. And if the object still cannot be retrieved, it will say another error message anyway. OTOH other HTTP errors (403 etc) are likely fatal and the user should be still informed about them. Signed-off-by: Petr Baudis <pasky@suse.cz> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'http-fetch.c')
-rw-r--r--http-fetch.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/http-fetch.c b/http-fetch.c
index 1ee1df20d6..a1b03cd9c8 100644
--- a/http-fetch.c
+++ b/http-fetch.c
@@ -1095,9 +1095,12 @@ static int fetch_object(struct alt_base *repo, unsigned char *sha1)
}
if (request->curl_result != CURLE_OK && request->http_code != 416) {
- ret = error("%s (curl_result = %d, http_code = %ld, sha1 = %s)",
- request->errorstr, request->curl_result,
- request->http_code, hex);
+ if (request->http_code == 404)
+ ret = -1; /* Be silent, it is probably in a pack. */
+ else
+ ret = error("%s (curl_result = %d, http_code = %ld, sha1 = %s)",
+ request->errorstr, request->curl_result,
+ request->http_code, hex);
release_request(request);
return ret;
}