diff --git a/git_cl.py b/git_cl.py index 0415fd4266..72bc1923e2 100755 --- a/git_cl.py +++ b/git_cl.py @@ -689,8 +689,7 @@ def _ComputeDiffLineRanges(files, upstream_commit): return {} # Take the git diff and find the line ranges where there are changes. - lines = '-U%s' % settings.GetDiffLinesOfContext() - diff_cmd = BuildGitDiffCmd(lines, upstream_commit, files, allow_prefix=True) + diff_cmd = BuildGitDiffCmd('-U0', upstream_commit, files, allow_prefix=True) diff_output = RunGit(diff_cmd) pattern = r'(?:^diff --git a/(?:.*) b/(.*))|(?:^@@.*\+(.*) @@)' @@ -939,10 +938,6 @@ class Settings(object): return (self._GetConfig('rietveld.cpplint-ignore-regex', error_ok=True) or DEFAULT_LINT_IGNORE_REGEX) - def GetDiffLinesOfContext(self): - return (self._GetConfig('rietveld.diff-lines-of-context', error_ok=True) or - "0") - def _GetConfig(self, param, **kwargs): self.LazyUpdateIfNeeded() return RunGit(['config', param], **kwargs).strip() @@ -3154,8 +3149,6 @@ def LoadCodereviewSettingsFromFile(fileobj): SetProperty('cpplint-ignore-regex', 'LINT_IGNORE_REGEX', unset_error_ok=True) SetProperty('run-post-upload-hook', 'RUN_POST_UPLOAD_HOOK', unset_error_ok=True) - SetProperty( - 'diff-lines-of-context', 'DIFF_LINES_OF_CONTEXT', unset_error_ok=True) if 'GERRIT_HOST' in keyvals: RunGit(['config', 'gerrit.host', keyvals['GERRIT_HOST']]) @@ -5189,8 +5182,7 @@ def CMDformat(parser, args): if not opts.dry_run and not opts.diff: cmd.append('-i') - lines = '-U%s' % settings.GetDiffLinesOfContext() - diff_cmd = BuildGitDiffCmd(lines, upstream_commit, clang_diff_files) + diff_cmd = BuildGitDiffCmd('-U0', upstream_commit, clang_diff_files) diff_output = RunGit(diff_cmd) stdout = RunCommand(cmd, stdin=diff_output, cwd=top_dir, env=env) diff --git a/tests/git_cl_test.py b/tests/git_cl_test.py index 6668b997a0..f6e5d6fef6 100755 --- a/tests/git_cl_test.py +++ b/tests/git_cl_test.py @@ -724,8 +724,6 @@ class TestGitCl(TestCase): CERR1), ((['git', 'config', '--unset-all', 'rietveld.run-post-upload-hook'],), CERR1), - ((['git', 'config', '--unset-all', 'rietveld.diff-lines-of-context'],), - CERR1), ((['git', 'config', 'gerrit.host', 'true'],), ''), ] self.assertIsNone(git_cl.LoadCodereviewSettingsFromFile(codereview_file))