pre-upload: Unbreak per-line checks.

Some of the per-line checks (line too long, stray whitespace, tab
characters in file) have been broken since

This CL fixes them.

TEST=Manual. Create a bogus CL with these issues and run

Change-Id: I51b6ee869a9264b3866d6b4b6fd21b79320fe9a6
Commit-Ready: Mike Frysinger <>
Tested-by: Prathmesh Prabhu <>
Reviewed-by: Mike Frysinger <>
diff --git a/ b/
index 2c14bb5..7677605 100755
--- a/
+++ b/
@@ -243,11 +243,12 @@
 def _get_file_diff(path, commit):
   """Returns a list of (linenum, lines) tuples that the commit touched."""
-  command = ['git', 'diff', '-p', '--pretty=format:', '--no-ext-diff']
   if commit == PRE_SUBMIT:
-    command += ['HEAD', path]
+    command = ['git', 'diff', '-p', '--pretty=format:', '--no-ext-diff', 'HEAD',
+               path]
-    command += [commit, path]
+    command = ['git', 'show', '-p', '--pretty=format:', '--no-ext-diff', commit,
+               path]
   output = _run_command(command)
   new_lines = []