Skip to content
Snippets Groups Projects
Commit 314b610f authored by Georg Seibt's avatar Georg Seibt :nerd:
Browse files

fix: empty commit was produced if there were no merge commits (String::split...

fix: empty commit was produced if there were no merge commits (String::split produced a 1 element array for an empty string)
parent 98873387
No related branches found
No related tags found
No related merge requests found
......@@ -115,10 +115,13 @@ public class Repository {
return null;
}
String[] lines = res.stdOut.split("[\\r?\\n]+");
String[] lines = res.stdOut.isEmpty() ? new String[] {} : res.stdOut.split("[\\r?\\n]+");
LOG.fine(() -> String.format("Found %d merge commits in %s.", lines.length, this));
LOG.finer(() -> String.format("Merge commits are:%n%s", String.join(System.lineSeparator(), lines)));
if (lines.length > 0) {
LOG.finer(() -> String.format("Merge commits are:%n%s", String.join(System.lineSeparator(), lines)));
}
return Arrays.stream(lines).map(this::getCommitUnchecked).collect(Collectors.toList());
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment