line += '\n'
if state == 0:
- if line.startswith('diff') or line.startswith('===') \
+ if line.startswith('diff ') or line.startswith('===') \
or line.startswith('Index: '):
state = 1
buf += line
(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()