git_auth: Inline single use helpers

Change-Id: I5ca184b59a3d592bb4121e8f4a9ec2e54665ef57
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/7173366
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Allen Li <ayatane@chromium.org>
This commit is contained in:
Allen Li
2025-12-02 17:12:59 -08:00
committed by LUCI CQ
parent 1acf6d271e
commit 9238ab49b6

View File

@@ -590,10 +590,10 @@ class ConfigWizard(object):
def _set_oauth_helper(self, parts: urllib.parse.SplitResult, *,
scope: scm.GitConfigScope) -> None:
cred_key = _creds_helper_key(parts)
cred_key = f'credential.{_url_host_url(parts)}.helper'
self._set_config(cred_key, '', modify_all=True, scope=scope)
self._set_config(cred_key, 'luci', append=True, scope=scope)
self._set_config(_creds_use_http_path_key(parts),
self._set_config(f'credential.{_url_host_url(parts)}.useHttpPath',
'yes',
modify_all=True,
scope=scope)
@@ -800,16 +800,6 @@ def _is_gerrit_url(url: str) -> bool:
return False
def _creds_helper_key(parts: urllib.parse.SplitResult) -> str:
"""Return Git config key for credential helpers."""
return f'credential.{_url_host_url(parts)}.helper'
def _creds_use_http_path_key(parts: urllib.parse.SplitResult) -> str:
"""Return Git config key for using path with helpers."""
return f'credential.{_url_host_url(parts)}.useHttpPath'
def _url_gerrit_sso_url(parts: urllib.parse.SplitResult) -> str:
"""Return the base SSO URL for a Gerrit host URL."""
return f'sso://{_url_shortname(parts)}/'