[git_cl] Move new auth handling up in creds-check

The CookiesAuthenticator is mutually exclusive with new auth.

Bug: b/348024314
Change-Id: I70f2e1976b54572c330fcc8acff30e8448e540ca
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5651990
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Commit-Queue: Allen Li <ayatane@chromium.org>
changes/90/5651990/4
Allen Li 1 year ago committed by LUCI CQ
parent cb5a8a3315
commit 0d470211d6

@ -3851,6 +3851,10 @@ def CMDcreds_check(parser, args):
"""Checks credentials and suggests changes."""
_, _ = parser.parse_args(args)
if newauth.Enabled():
ConfigureGitRepoAuth()
return 0
# Code below checks .gitcookies. Abort if using something else.
authn = gerrit_util.Authenticator.get()
if not isinstance(authn, gerrit_util.CookiesAuthenticator):
@ -3866,19 +3870,16 @@ def CMDcreds_check(parser, args):
'export SKIP_GCE_AUTH_FOR_GIT=1 in your env.')
DieWithError(message)
if newauth.Enabled():
ConfigureGitRepoAuth()
else:
checker = _GitCookiesChecker()
checker.ensure_configured_gitcookies()
checker = _GitCookiesChecker()
checker.ensure_configured_gitcookies()
print('Your .gitcookies have credentials for these hosts:')
checker.print_current_creds()
print('Your .gitcookies have credentials for these hosts:')
checker.print_current_creds()
if not checker.find_and_report_problems():
print('\nNo problems detected in your .gitcookies file.')
return 0
return 1
if not checker.find_and_report_problems():
print('\nNo problems detected in your .gitcookies file.')
return 0
return 1
@metrics.collector.collect_metrics('git cl baseurl')

Loading…
Cancel
Save