File tree Expand file tree Collapse file tree
src/main/java/org/variantsync/diffdetective/variation/diff/construction Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1616import java .io .IOException ;
1717import java .io .StringReader ;
1818import java .nio .charset .StandardCharsets ;
19+ import java .util .regex .Pattern ;
1920
2021/**
2122 * Class which groups functions of parsing variation diffs with JGit.
2223 * @author Paul Bittner
2324 */
2425public final class JGitDiff {
26+ private final static Pattern NO_NEWLINE_AT_END_OF_FILE = Pattern .compile ("\n \\ \\ No newline at end of file" );
27+
2528 private JGitDiff () {}
2629
2730 /**
@@ -90,7 +93,8 @@ Using our own formatter without diff headers (paired with a maximum context (?))
9093 new BufferedReader (new StringReader (textDiff ))
9194 );
9295
93- //textDiff = textDiff.replace("\\ No newline at end of file\n", "");
96+
97+ textDiff = NO_NEWLINE_AT_END_OF_FILE .matcher (textDiff ).replaceAll ("" );
9498 //textDiff = HUNK_HEADER_REGEX.matcher(textDiff).replaceAll("");
9599
96100 final VariationDiff <DiffLinesLabel > d ;
You can’t perform that action at this time.
0 commit comments