diff --git a/git_cl.py b/git_cl.py index 07597d4d1..d40a94dca 100755 --- a/git_cl.py +++ b/git_cl.py @@ -3727,17 +3727,20 @@ class GitAuthConfigChanger(object): # https://chromium.googlesource.com/chromium/tools/depot_tools.git remote_url: str = cl.GetRemoteUrl() - mode: GitConfigMode = GitConfigMode.NEW_AUTH - if gerrit_util.ShouldUseSSO(gerrit_host): - mode = GitConfigMode.NEW_AUTH_SSO - return cls( cwd=os.getcwd(), host_shortname=host_shortname, - mode=mode, + mode=cls._infer_mode(), remote_url=remote_url, ) + @staticmethod + def _infer_mode() -> GitConfigMode: + """Infer default mode to use.""" + if gerrit_util.ShouldUseSSO(gerrit_host): + return GitConfigMode.NEW_AUTH_SSO + return GitConfigMode.NEW_AUTH + def apply(self) -> None: """Apply config changes.""" self._apply_cred_helper()