]> git.frustrated-labs.net Git - gradle-changelog-plugin.git/commitdiff
fix: handle case where we are running the task from the base branch
authorAlexander Goussas <[email protected]>
Sun, 26 Oct 2025 04:08:23 +0000 (23:08 -0500)
committerAlexander Goussas <[email protected]>
Sun, 26 Oct 2025 04:08:23 +0000 (23:08 -0500)
changelog-plugin/src/main/kotlin/io/github/aloussase/changelog/git/commands/GetCurrentBranchCommitsCommand.kt

index 975b4481740341a7b65284ede97a1ca333872c83..cd6c564c35a8ac744cefa7c51d0a1dc83f0f86a8 100644 (file)
@@ -10,7 +10,8 @@ class GetCurrentBranchCommitsCommand(
         get() = "git log $baseBranch..HEAD --no-merges --oneline --pretty=format:\"%an|%s\""
 
     override fun transform(rawOutput: String): List<RawCommit> =
-        rawOutput
+        if (rawOutput.isEmpty()) emptyList()
+        else rawOutput
             .split("\n")
             .map { it.split("|") }
             .map { RawCommit(it[0], it[1]) }