mirror of
https://gerrit.googlesource.com/git-repo
synced 2025-02-01 16:14:28 +00:00
Handle 400 error code when attempting to fetch clone bundle.
Gitlab returns a 400 error when trying to fetch clone.bundle from a repository containing the git-repo tool. The repo launcher doesn't then fall back to not using a clone.bundle file and the repo init fails. Change-Id: Ia3390d0638ef9a39fb2fab84625b269d28caf1cc Signed-off-by: Craig Northway <cnorthway@codeaurora.org> Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/305382 Reviewed-by: Mike Frysinger <vapier@google.com>
This commit is contained in:
parent
23ea754524
commit
0e8828c47b
11
repo
11
repo
@ -117,7 +117,7 @@ def check_python_version():
|
||||
|
||||
# If the python3 version looks like it's new enough, give it a try.
|
||||
if (python3_ver and python3_ver >= MIN_PYTHON_VERSION_HARD
|
||||
and python3_ver != (major, minor)):
|
||||
and python3_ver != (major, minor)):
|
||||
reexec('python3')
|
||||
|
||||
# We're still here, so diagnose things for the user.
|
||||
@ -859,11 +859,10 @@ def _DownloadBundle(url, cwd, quiet, verbose):
|
||||
try:
|
||||
r = urllib.request.urlopen(url)
|
||||
except urllib.error.HTTPError as e:
|
||||
if e.code in [401, 403, 404, 501]:
|
||||
return False
|
||||
print('fatal: Cannot get %s' % url, file=sys.stderr)
|
||||
print('fatal: HTTP error %s' % e.code, file=sys.stderr)
|
||||
raise CloneFailure()
|
||||
if e.code not in [400, 401, 403, 404, 501]:
|
||||
print('warning: Cannot get %s' % url, file=sys.stderr)
|
||||
print('warning: HTTP error %s' % e.code, file=sys.stderr)
|
||||
return False
|
||||
except urllib.error.URLError as e:
|
||||
print('fatal: Cannot get %s' % url, file=sys.stderr)
|
||||
print('fatal: error %s' % e.reason, file=sys.stderr)
|
||||
|
Loading…
Reference in New Issue
Block a user