Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(103)

Unified Diff: git_cl.py

Issue 2272613002: git cl: workaround against integer overflows of git config. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tests/git_cl_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: git_cl.py
diff --git a/git_cl.py b/git_cl.py
index c43b62106110ac5a351f6cf5bcbfcb557d04da02..99c101e8506ea70083dfe1840979021b8822ea5a 100755
--- a/git_cl.py
+++ b/git_cl.py
@@ -176,10 +176,10 @@ def _git_get_branch_config_value(key, default=None, value_type=str,
return default
args = ['config']
- if value_type == int:
- args.append('--int')
- elif value_type == bool:
+ if value_type == bool:
args.append('--bool')
+ # git config also has --int, but apparently git config suffers from integer
+ # overflows (http://crbug.com/640115), so don't use it.
args.append(_git_branch_config_key(branch, key))
code, out = RunGitWithCode(args)
if code == 0:
@@ -208,10 +208,9 @@ def _git_set_branch_config_value(key, value, branch=None, **kwargs):
elif isinstance(value, bool):
args.append('--bool')
value = str(value).lower()
- elif isinstance(value, int):
- args.append('--int')
- value = str(value)
else:
+ # git config also has --int, but apparently git config suffers from integer
+ # overflows (http://crbug.com/640115), so don't use it.
value = str(value)
args.append(_git_branch_config_key(branch, key))
if value is not None:
« no previous file with comments | « no previous file | tests/git_cl_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698