Skip to content

Commit 08840f4

Browse files
committed
Git index revision ids might have more that 7 characters.
1 parent ac751d1 commit 08840f4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

whatthepatch/patch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141

4242
# git has a special index header and no end part
4343
git_diffcmd_header = re.compile('^diff --git a/(.+) b/(.+)$')
44-
git_header_index = re.compile('^index ([\w]{7})..([\w]{7}) ?(\d*)$')
44+
git_header_index = re.compile('^index ([a-f0-9]+)..([a-f0-9]+) ?(\d*)$')
4545
git_header_old_line = re.compile('^--- (.+)$')
4646
git_header_new_line = re.compile('^\+\+\+ (.+)$')
4747
git_header_file_mode = re.compile('^(new|deleted) file mode \d{6}$')

0 commit comments

Comments
 (0)