Commit 768ec9a7 authored by tandrii's avatar tandrii Committed by Commit bot

Gerrit git cl: allow overriding GERRIT_SQUASH_UPLOADS in git config.

Previously, if GERRIT_SQUASH_UPLOADS was found in codereview.settings,
a local repository value of gerrit.squash-uploads would be set.

This CL changes that, so that gerrit.squash-uploads property is written
with GERRIT_SQUASH_UPLOADS value ONLY IF the property wasn't set before.

This allows individual users to choose their own way with
  git config [--global] -bool gerrit.squash-uploads (true|false)

BUG=611892
R=andybons@chromium.org,sergiyb@chromium.org

Review-Url: https://codereview.chromium.org/2070013002
parent 091b7db6
......@@ -2835,8 +2835,10 @@ def LoadCodereviewSettingsFromFile(fileobj):
RunGit(['config', 'gerrit.host', keyvals['GERRIT_HOST']])
if 'GERRIT_SQUASH_UPLOADS' in keyvals:
RunGit(['config', 'gerrit.squash-uploads',
keyvals['GERRIT_SQUASH_UPLOADS']])
cur = RunGit(['config', '--bool', 'gerrit.squash-uploads'], error_ok=True)
if not cur: # Set the value only if it wasn't set by the user manually.
RunGit(['config', 'gerrit.squash-uploads',
keyvals['GERRIT_SQUASH_UPLOADS']])
if 'GERRIT_SKIP_ENSURE_AUTHENTICATED' in keyvals:
RunGit(['config', 'gerrit.skip-ensure-authenticated',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment