Skip to content

Commit

Permalink
Silence confusing and false-positive curl error message
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Petr Baudis authored and Junio C Hamano committed Oct 23, 2005
1 parent 8ac3a61 commit e2029eb
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions http-fetch.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit e2029eb

Please sign in to comment.