mirror of
https://chromium.googlesource.com/chromium/tools/depot_tools.git
synced 2026-01-11 18:51:29 +00:00
[git_auth] Rename GitAuthConfigChanger
Bug: b/351071334 Change-Id: Ia12bf72bfaef11768cb60ba0631aafd5ffc9f1fd Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5739676 Reviewed-by: Yiwei Zhang <yiwzhang@google.com> Commit-Queue: Allen Li <ayatane@chromium.org>
This commit is contained in:
10
git_cl.py
10
git_cl.py
@@ -2346,7 +2346,7 @@ class Changelist(object):
|
||||
return
|
||||
|
||||
if newauth.Enabled():
|
||||
latestVer: int = git_auth.GitAuthConfigChanger.VERSION
|
||||
latestVer: int = git_auth.ConfigChanger.VERSION
|
||||
v: int = 0
|
||||
try:
|
||||
v = int(
|
||||
@@ -3674,11 +3674,11 @@ def ConfigureGitAuth() -> None:
|
||||
# We want the user's global config.
|
||||
# We can probably assume the root directory doesn't have any local
|
||||
# Git configuration.
|
||||
c = git_auth.GitAuthConfigChanger.new_from_env('/')
|
||||
c = git_auth.ConfigChanger.new_from_env('/')
|
||||
c.apply_global(os.path.expanduser('~'))
|
||||
|
||||
cwd = os.getcwd()
|
||||
c2 = git_auth.GitAuthConfigChanger.new_from_env(cwd)
|
||||
c2 = git_auth.ConfigChanger.new_from_env(cwd)
|
||||
if c2.mode == c.mode:
|
||||
logging.debug(
|
||||
'Local user wants same mode %s as global; clearing local repo auth config',
|
||||
@@ -3696,14 +3696,14 @@ def ConfigureGitRepoAuth() -> None:
|
||||
"""Configure the current Git repo authentication."""
|
||||
logging.debug('Configuring current Git repo authentication...')
|
||||
cwd = os.getcwd()
|
||||
c = git_auth.GitAuthConfigChanger.new_from_env(cwd)
|
||||
c = git_auth.ConfigChanger.new_from_env(cwd)
|
||||
c.apply(cwd)
|
||||
|
||||
|
||||
def ClearGitRepoAuth() -> None:
|
||||
"""Clear the current Git repo authentication."""
|
||||
logging.debug('Clearing current Git repo authentication...')
|
||||
c = git_auth.GitAuthConfigChanger.new_from_env(cwd)
|
||||
c = git_auth.ConfigChanger.new_from_env(cwd)
|
||||
c.mode = git_auth.ConfigMode.NO_AUTH
|
||||
c.apply(cwd)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user