Ignore /clone.bundle on HTTP 401, 403 and 404

401: Unauthorized, authentication may be required. This is usually
     handled internally by the HTTP client in Python. If it reaches
     our code in repo, the Python HTTP client didn't find a password
     in ~/.netrc that it could use.

403: Authentication was supplied, but is incorrect. It might be
     that the CDN doesn't want to offer this clone.bundle file
     to the client, but the Git fetch operation would still be
     successful. This might arise if branch level read controls
     were used in Gerrit Code Review and the /clone.bundle file
     contained branches not visible to the client.

404: The server has no /clone.bundle file available.

In all of these cases, sliently ignore the /clone.bundle file HTTP
error and let the Git operation take over.

Change-Id: I1787f3cac86b017351952bbb793fe5874d83c72b
This commit is contained in:
Shawn O. Pearce 2012-03-22 14:09:22 -07:00
parent cd7c5deca0
commit c3d2f2b76f

View File

@ -1516,7 +1516,7 @@ class Project(object):
except: except:
return None return None
if e.code == 404: if e.code in (401, 403, 404):
keep = False keep = False
return False return False
elif _content_type() == 'text/plain': elif _content_type() == 'text/plain':