Skip to content

Parsing fails on certain patch files #10

Description

@akirekadu

I see the following Exception while parsing a simple Git-generated patch file:

Exception in thread "main" com.zutubi.diff.PatchParseException: 10: Hunk old length 1 is not consistent with hunk lines
at com.zutubi.diff.unified.UnifiedPatchParser.checkConsistency(UnifiedPatchParser.java:259)
at com.zutubi.diff.unified.UnifiedPatchParser.parse(UnifiedPatchParser.java:146)
at com.zutubi.diff.git.GitPatchParser.parse(GitPatchParser.java:131)
at com.zutubi.diff.git.GitPatchParser.parse(GitPatchParser.java:64)
at com.zutubi.diff.PatchFileParser.read(PatchFileParser.java:69)
at com.zutubi.diff.PatchFileParser.parse(PatchFileParser.java:45)
at internal.tryout.ChangeListParser.main(ChangeListParser.java:24)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)

Sample patch file:
(https://github.com/Zutubi/com.zutubi.diff/files/859422/0001-added-second-line-to-1.txt.patch.txt)

Code used for testing:
ChangeListParser.txt

`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions