Open
Description
The regex, which is currently used in the project to detect GIT patches, doesn't cover all cases. It assumes having index shortcut length equal to 7, which is not always the case. Shortcut length of the index inserted in the patch seems to depend on the project size (git objects in the git cache) and may vary. E.g. for qt project it would be 10. Another unhandled case is git format-patch --full-index
that produces full-sized index (40 characters).
Incorrectly determined type causes missing a/
or b/
prefix strip and patch-ng
fails to apply a patch.
Proposal (PR #39):
Use b'(?:index \\w{7,40}..\\w{7,40} \\d{6}|new file mode \\d*)'
instead of b'(?:index \\w{7}..\\w{7} \\d{6}|new file mode \\d*)'
in the _detect_type()
function.
Metadata
Metadata
Assignees
Labels
No labels