mirror of
https://chromium.googlesource.com/chromium/tools/depot_tools.git
synced 2026-01-11 18:51:29 +00:00
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:
14
git_auth.py
14
git_auth.py
@@ -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)}/'
|
||||
|
||||
Reference in New Issue
Block a user