UnifiedDiff Separator Rule
elanzini opened this issue · comments
Describe the bug
I tried to parse this diff but I am getting an error. The problem seems to be with WARNING: >>> no rule matched Index: src/java/main/org/apache/zookeeper/server/FinalRequestProcessor.java
that is separating the two patches. There is no rule that matches this separator. I am not sure whether this is standard format of separating patches and should be handled. If you think this case doesn't need to be handled, feel free to close the issue and I will work around it in my code.
To Reproduce
You can simply save the diff as diff.txt
file and then parse it as follows:
FileInputStream stream = new FileInputStream(new File("/path/to/diff.txt"));
UnifiedDiff patch = UnifiedDiffReader.parseUnifiedDiff(stream); <-- ERROR
Expected behavior
I expected the UnifiedDiffReader
to be able to parse the provided diff.
The new version fixes this problem. I was not aware, that each file could have a header section.