[git_auth] Rename configure functions

Bug: b/351071334
Change-Id: Ic0378590bd678226db2563e9180076f87dafdc66
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5739678
Commit-Queue: Allen Li <ayatane@chromium.org>
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
changes/78/5739678/18
Allen Li 10 months ago committed by LUCI CQ
parent 1590dceac5
commit db74f93ff9

@ -223,7 +223,7 @@ class ConfigChanger(object):
self._set_config_func(*args, **kwargs)
def ConfigureGitAuth(cwd: str, cl: git_cl.Changelist) -> None:
def Configure(cwd: str, cl: git_cl.Changelist) -> None:
"""Configure Git authentication.
This may modify the global Git config and the local repo config as
@ -253,14 +253,14 @@ def ConfigureGitAuth(cwd: str, cl: git_cl.Changelist) -> None:
c2.apply(cwd)
def ConfigureGitRepoAuth(cwd: str, cl: git_cl.Changelist) -> None:
def ConfigureRepo(cwd: str, cl: git_cl.Changelist) -> None:
"""Configure the current Git repo authentication."""
logging.debug('Configuring current Git repo authentication...')
c = ConfigChanger.new_from_env(cwd, cl)
c.apply(cwd)
def ClearGitRepoAuth(cwd: str, cl: git_cl.Changelist) -> None:
def ClearRepoConfig(cwd: str, cl: git_cl.Changelist) -> None:
"""Clear the current Git repo authentication."""
logging.debug('Clearing current Git repo authentication...')
c = ConfigChanger.new_from_env(cwd, cl)

@ -2360,7 +2360,7 @@ class Changelist(object):
logging.debug(
'Automatically configuring Git repo authentication (current version: %r, latest: %r)',
v, latestVer)
git_auth.ConfigureGitRepoAuth(os.getcwd(), Changelist())
git_auth.ConfigureRepo(os.getcwd(), Changelist())
scm.GIT.SetConfig(settings.GetRoot(),
'depot-tools.gitAuthAutoConfigured',
str(latestVer))
@ -3892,10 +3892,10 @@ def CMDcreds_check(parser, args):
_, _ = parser.parse_args(args)
if newauth.Enabled():
git_auth.ConfigureGitAuth(os.getcwd(), Changelist())
git_auth.Configure(os.getcwd(), Changelist())
return 0
if newauth.ExplicitlyDisabled():
git_auth.ClearGitRepoAuth(os.getcwd(), Changelist())
git_auth.ClearRepoConfig(os.getcwd(), Changelist())
# Code below checks .gitcookies. Abort if using something else.
auth_name, _ = gerrit_util.debug_auth()

Loading…
Cancel
Save