lc[0] -= 1
elif line.startswith('+'):
lc[1] -= 1
+ elif line.startswith('\ No newline at end of file'):
+ # Special case: Not included as part of the hunk's line count
+ pass
else:
lc[0] -= 1
lc[1] -= 1
(options, args) = parser.parse_args()
- (patch, comment) = parse_patch(sys.stdin.read())
+ # decode from (assumed) UTF-8
+ content = sys.stdin.read().decode('utf-8')
+
+ (patch, comment) = parse_patch(content)
if options.print_hash and patch:
print hash_patch(patch).hexdigest()