[git_cl] Apply OLD_AUTH if new auth flag is off

Note that this logic still isn't run yet, because we only call
ConfigureGitRepoAuth behind new auth flag checks.

Bug: b/351024645
Change-Id: Idca4d1ce3ebd3f2c673f244f85b3cae6da39f8e5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5699188
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Commit-Queue: Allen Li <ayatane@chromium.org>
This commit is contained in:
Allen Li
2024-07-15 22:42:10 +00:00
committed by LUCI CQ
parent 53c429b8d7
commit 9b51399218

View File

@@ -3737,6 +3737,8 @@ class GitAuthConfigChanger(object):
@staticmethod
def _infer_mode() -> GitConfigMode:
"""Infer default mode to use."""
if not newauth.Enabled():
return GitConfigMode.OLD_AUTH
if gerrit_util.ShouldUseSSO(gerrit_host):
return GitConfigMode.NEW_AUTH_SSO
return GitConfigMode.NEW_AUTH