Pass --no-renames to git diff
If ~/.gitconfig contains:
[diff]
renames = "true"
then git diff --name-status will produce output that confuses the parsing
in svm.GIT.CaptureStatus and git diff will produce output that confuses the
patch command on trybots. Passing --no-renames explicitly counteracts this.
Review URL: https://chromiumcodereview.appspot.com/16057018
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@203778 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/scm.py b/scm.py
index 4e9c11c..7293f83 100644
--- a/scm.py
+++ b/scm.py
@@ -113,7 +113,8 @@
upstream_branch = GIT.GetUpstreamBranch(cwd)
if upstream_branch is None:
raise gclient_utils.Error('Cannot determine upstream branch')
- command = ['diff', '--name-status', '-r', '%s...' % upstream_branch]
+ command = ['diff', '--name-status', '--no-renames',
+ '-r', '%s...' % upstream_branch]
if not files:
pass
elif isinstance(files, basestring):
@@ -346,7 +347,9 @@
branch = GIT.GetUpstreamBranch(cwd)
command = ['diff', '-p', '--no-color', '--no-prefix', '--no-ext-diff',
branch + "..." + branch_head]
- if not full_move:
+ if full_move:
+ command.append('--no-renames')
+ else:
command.append('-C')
# TODO(maruel): --binary support.
if files: