Skip to content

Commit 8397e20

Browse files
fix: parsing unified diff chunk headers (#198)
The regex matching chunk headers does not account for diffs generated with --show-function-line
1 parent 110a0da commit 8397e20

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

java-diff-utils/src/main/java/com/github/difflib/UnifiedDiffUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
public final class UnifiedDiffUtils {
3737

3838
private static final Pattern UNIFIED_DIFF_CHUNK_REGEXP = Pattern
39-
.compile("^@@\\s+-(?:(\\d+)(?:,(\\d+))?)\\s+\\+(?:(\\d+)(?:,(\\d+))?)\\s+@@$");
39+
.compile("^@@\\s+-(\\d+)(?:,(\\d+))?\\s+\\+(\\d+)(?:,(\\d+))?\\s+@@.*$");
4040
private static final String NULL_FILE_INDICATOR = "/dev/null";
4141

4242
/**

0 commit comments

Comments
 (0)