فهرست منبع

[win-bootstrap] Use git config commands supported by older versions

In git 2.41, both `list` and `unset` are only options, `--list` and `--unset` respectively. See https://git-scm.com/docs/git-config/2.41.0

These modes are deprecated in later versions; it is recommended to
migrate to the newer syntax, but the old syntax is still supported.

Bug: b/382395049
Change-Id: I9150983084b91279e4f4587a80737e6813937cd6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6083215
Commit-Queue: Anne Redulla <aredulla@google.com>
Reviewed-by: Peter Boström <pbos@chromium.org>
Owners-Override: Anne Redulla <aredulla@google.com>
Anne Redulla 8 ماه پیش
والد
کامیت
719139c30a
1فایلهای تغییر یافته به همراه5 افزوده شده و 4 حذف شده
  1. 5 4
      bootstrap/bootstrap.py

+ 5 - 4
bootstrap/bootstrap.py

@@ -361,9 +361,10 @@ def get_git_global_config(git_path):
         # us to securely parse the output even if a value contains line breaks.
         # See docs at:
         # https://git-scm.com/docs/git-config#Documentation/git-config.txt--z
-        stdout, _ = _check_call([git_path, 'config', 'list', '--global', '-z'],
-                                stdout=subprocess.PIPE,
-                                encoding='utf-8')
+        stdout, _ = _check_call(
+            [git_path, 'config', '--list', '--global', '-z'],
+            stdout=subprocess.PIPE,
+            encoding='utf-8')
     except subprocess.CalledProcessError as e:
         raise e
 
@@ -445,7 +446,7 @@ def _win_git_bootstrap_config():
     postprocess_key = 'depot-tools.gitPostprocessVersion'
     if current_config.get(postprocess_key) != None:
         _check_call(
-            [git_bat_path, 'config', 'unset', '--global', postprocess_key])
+            [git_bat_path, 'config', '--unset', '--global', postprocess_key])
 
 
 def git_postprocess(template, add_docs):