Browse Source

[win-bootstrap] Only update mismatching settings in global git config

Change-Id: I781a2b6cb11f8a13f4555bffc522f8dd85c40351
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6073289
Reviewed-by: Allen Li <ayatane@chromium.org>
Commit-Queue: Anne Redulla <aredulla@google.com>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Anne Redulla 8 months ago
parent
commit
b4382c66d9
1 changed files with 4 additions and 3 deletions
  1. 4 3
      bootstrap/bootstrap.py

+ 4 - 3
bootstrap/bootstrap.py

@@ -436,9 +436,10 @@ def _win_git_bootstrap_config():
         logging.warning('\n'.join(lines))
         logging.warning('\n'.join(lines))
         return
         return
 
 
-    # Global git config changes have been authorized - do the update.
-    for k, v in GIT_GLOBAL_CONFIG.items():
-        _check_call([git_bat_path, 'config', '--global', k, v])
+    # Global git config changes have been authorized - do the necessary updates.
+    for k in mismatching_keys:
+        desired = GIT_GLOBAL_CONFIG.get(k)
+        _check_call([git_bat_path, 'config', '--global', k, desired])
 
 
     # Clean up deprecated setting depot-tools.gitPostprocessVersion.
     # Clean up deprecated setting depot-tools.gitPostprocessVersion.
     postprocess_key = 'depot-tools.gitPostprocessVersion'
     postprocess_key = 'depot-tools.gitPostprocessVersion'