浏览代码

[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>
Allen Li 1 年之前
父节点
当前提交
db74f93ff9
共有 2 个文件被更改,包括 6 次插入6 次删除
  1. 3 3
      git_auth.py
  2. 3 3
      git_cl.py

+ 3 - 3
git_auth.py

@@ -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)

+ 3 - 3
git_cl.py

@@ -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()