mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-01 11:05:56 +01:00
Only use LF for line breaks in diffs
Git uses LF for line breaks in diffs, not CR or other delimiters. When we are using other delimiters for diving diff output into lines, too, we can get errors because diff lines can contain CRs. When we try to split such lines, we get exceptions because these lines cannot be parsed
This commit is contained in:
@@ -49,7 +49,7 @@ final class GitHunkParser {
|
||||
public List<Hunk> parse(String content) {
|
||||
List<Hunk> hunks = new ArrayList<>();
|
||||
|
||||
try (Scanner scanner = new Scanner(content).useDelimiter("[\n\r\u2028\u2029\u0085]+")) {
|
||||
try (Scanner scanner = new Scanner(content).useDelimiter("\n")) {
|
||||
while (scanner.hasNext()) {
|
||||
String line = scanner.next();
|
||||
if (line.startsWith("@@")) {
|
||||
|
||||
Reference in New Issue
Block a user