self.error('Empty commit message!')\r
return\r
\r
- if count >= 1 and len(lines[0]) >= 72:\r
+ if count >= 1 and len(lines[0].rstrip()) >= 72:\r
self.error('First line of commit message (subject line) ' +\r
'is too long.')\r
\r
if line.startswith('@@ '):\r
self.state = PRE_PATCH\r
elif len(line) >= 1 and line[0] not in ' -+' and \\r
+ not line.startswith('\r\n') and \\r
not line.startswith(r'\ No newline ') and not self.binary:\r
for line in self.lines[self.line_num + 1:]:\r
if line.startswith('diff --git'):\r
pass\r
elif line.startswith('+'):\r
self.check_added_line(line[1:])\r
+ elif line.startswith('\r\n'):\r
+ pass\r
elif line.startswith(r'\ No newline '):\r
pass\r
elif not line.startswith(' '):\r
'old mode ',\r
'new mode ',\r
'similarity index ',\r
+ 'copy from ',\r
+ 'copy to ',\r
'rename ',\r
)\r
\r
\r
def read_patch_from_git(self, commit):\r
# Run git to get the commit patch\r
- return self.run_git('show', '--pretty=email', commit)\r
+ return self.run_git('show', '--pretty=email', '--no-textconv', commit)\r
\r
def run_git(self, *args):\r
cmd = [ 'git' ]\r