java-diff-utils / java-diff-utils

Diff Utils library is an OpenSource library for performing the comparison / diff operations between texts or some kind of data: computing diffs, applying patches, generating unified diffs or parsing them, generating diff output for easy future displaying (like side-by-side view) and so on.

Home Page:https://java-diff-utils.github.io/java-diff-utils/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

UNIFIED_DIFF_CHUNK_REGEXP should include header

michaelprichardson opened this issue · comments

Describe the bug
The UNIFIED_DIFF_CHUNK_REGEXP regex is looking for @@ -9,6 +9,10 @@ but needs to included optional text afterwards, @@ -9,6 +9,10 @@ node_modules

To Reproduce
Steps to reproduce the behavior:

  1. Use a patch that has the function header on the chunk like:
--- a/.gitignore
+++ b/.gitignore
@@ -9,6 +9,10 @@ node_modules
 /.DS_Store
 /.settings
 /.project
+/temp

Expected behavior
Should be able to parse in both patches. After doing some research this is in newer version of git but I may be wrong