Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion patch_ng.py
Original file line number Diff line number Diff line change
Expand Up @@ -706,8 +706,10 @@ def _detect_type(self, p):
if p.header[idx].startswith(b"diff --git"):
break
if p.header[idx].startswith(b'diff --git a/'):
# git-format-patch with --full-index generates full blob index, which is 40 symbols length
# shortcut index length may vary, seems to depend on the project size
if (idx+1 < len(p.header)
and re.match(b'(?:index \\w{7}..\\w{7} \\d{6}|new file mode \\d*)', p.header[idx+1])):
and re.match(b'(?:index \\w{7,40}..\\w{7,40} \\d{6}|new file mode \\d*)', p.header[idx+1])):
if DVCS:
return GIT

Expand Down