From b97353c82e863cdcb5a0e0f3c8a328c5ef9b3849 Mon Sep 17 00:00:00 2001 From: Martin Wittlinger Date: Sat, 24 Jun 2023 19:35:56 +0200 Subject: [PATCH] =?UTF-8?q?fix(git):=20=F0=9F=90=9B=20Fix=20newlines=20aft?= =?UTF-8?q?er=20refactoring=20and=20cleaning=20diff?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../spoon/code_solver/diffs/ExtraWhiteSpaceCleaner.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code-transformation/src/main/java/xyz/keksdose/spoon/code_solver/diffs/ExtraWhiteSpaceCleaner.java b/code-transformation/src/main/java/xyz/keksdose/spoon/code_solver/diffs/ExtraWhiteSpaceCleaner.java index 1517bdd76..0e8b502d3 100644 --- a/code-transformation/src/main/java/xyz/keksdose/spoon/code_solver/diffs/ExtraWhiteSpaceCleaner.java +++ b/code-transformation/src/main/java/xyz/keksdose/spoon/code_solver/diffs/ExtraWhiteSpaceCleaner.java @@ -30,7 +30,7 @@ public String clean(@Var String content, GitLineChange gitLineChange, Change cha .collect(Collectors.joining(lineEnding)); } } - if (endsWithLineEnding && !patch.getDeltas().isEmpty()) { + if (endsWithLineEnding && !patch.getDeltas().isEmpty() && !content.endsWith(lineEnding)) { content += lineEnding; } return content;