patch: a little bit more robust line counting on diff --stat (issue3183)

This commit is contained in:
Jesus Espino Garcia 2012-01-21 23:50:58 +01:00
parent 16484a55ad
commit 9146d99b1d

View File

@ -1802,9 +1802,9 @@ def diffstatdata(lines):
elif line.startswith('diff -r'):
# format: "diff -r ... -r ... filename"
filename = diffre.search(line).group(1)
elif line.startswith('+') and not line.startswith('+++'):
elif line.startswith('+') and not line.startswith('+++ '):
adds += 1
elif line.startswith('-') and not line.startswith('---'):
elif line.startswith('-') and not line.startswith('--- '):
removes += 1
elif (line.startswith('GIT binary patch') or
line.startswith('Binary file')):