From: Alexander Goussas Date: Sun, 26 Oct 2025 04:08:23 +0000 (-0500) Subject: fix: handle case where we are running the task from the base branch X-Git-Url: http://git.frustrated-labs.net/?a=commitdiff_plain;h=33d287bdc34fab70693d2cfffc77fb19498ab7cf;p=gradle-changelog-plugin.git fix: handle case where we are running the task from the base branch --- diff --git a/changelog-plugin/src/main/kotlin/io/github/aloussase/changelog/git/commands/GetCurrentBranchCommitsCommand.kt b/changelog-plugin/src/main/kotlin/io/github/aloussase/changelog/git/commands/GetCurrentBranchCommitsCommand.kt index 975b448..cd6c564 100644 --- a/changelog-plugin/src/main/kotlin/io/github/aloussase/changelog/git/commands/GetCurrentBranchCommitsCommand.kt +++ b/changelog-plugin/src/main/kotlin/io/github/aloussase/changelog/git/commands/GetCurrentBranchCommitsCommand.kt @@ -10,7 +10,8 @@ class GetCurrentBranchCommitsCommand( get() = "git log $baseBranch..HEAD --no-merges --oneline --pretty=format:\"%an|%s\"" override fun transform(rawOutput: String): List = - rawOutput + if (rawOutput.isEmpty()) emptyList() + else rawOutput .split("\n") .map { it.split("|") } .map { RawCommit(it[0], it[1]) }