A patch consisting entirely of binary diffs is not recognized by
Patch. Make Mbox.is_patch detect binary diffs to fix it.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
mbox.py | 15 +++------------
1 file changed, 3 insertions(+), 12 deletions(-)
diff --git a/mbox.py b/mbox.py
index 47a770f..16b3fc9 100644
--- a/mbox.py
+++ b/mbox.py
@@ -253,18 +253,9 @@ class MboxMessage(object):
body = self.get_body()
if self.get_subject().startswith("Re:"):
return False
- return self._has_lines(body,
- "---",
- "diff ",
- "index ",
- "---",
- "+++",
- "@@") or \
- self._has_lines(body,
- "---",
- "diff ",
- "old mode ",
- "new mode ")
+ return self._has_lines(body, "---", "diff ", "index ", "---", "+++", "@@") or \
+ self._has_lines(body, "---", "diff ", "index ", "GIT binary patch") or \
+ self._has_lines(body, "---", "diff ", "old mode ", "new mode ")
def is_series_head(self):
"""Create and return a Series from Message if it is one, otherwise
--
2.21.0
_______________________________________________
Patchew-devel mailing list
Patchew-devel@redhat.com
https://www.redhat.com/mailman/listinfo/patchew-devel
On 5/6/19 1:56 AM, Paolo Bonzini wrote:
> A patch consisting entirely of binary diffs is not recognized by
> Patch. Make Mbox.is_patch detect binary diffs to fix it.
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
> mbox.py | 15 +++------------
> 1 file changed, 3 insertions(+), 12 deletions(-)
>
> diff --git a/mbox.py b/mbox.py
> index 47a770f..16b3fc9 100644
> --- a/mbox.py
> +++ b/mbox.py
> @@ -253,18 +253,9 @@ class MboxMessage(object):
> body = self.get_body()
> if self.get_subject().startswith("Re:"):
> return False
> - return self._has_lines(body,
> - "---",
> - "diff ",
> - "index ",
> - "---",
> - "+++",
> - "@@") or \
> - self._has_lines(body,
> - "---",
> - "diff ",
> - "old mode ",
> - "new mode ")
> + return self._has_lines(body, "---", "diff ", "index ", "---", "+++", "@@") or \
> + self._has_lines(body, "---", "diff ", "index ", "GIT binary patch") or \
> + self._has_lines(body, "---", "diff ", "old mode ", "new mode ")
>
> def is_series_head(self):
> """Create and return a Series from Message if it is one, otherwise
>
_______________________________________________
Patchew-devel mailing list
Patchew-devel@redhat.com
https://www.redhat.com/mailman/listinfo/patchew-devel
© 2016 - 2025 Red Hat, Inc.