]> git.frustrated-labs.net Git - gradle-changelog-plugin.git/blob
e2d440aa286cd907584a872b66cfcfb5549c8258
[gradle-changelog-plugin.git] /
1 package io.github.aloussase.changelog.git.commands
2
3 import io.github.aloussase.changelog.git.RawCommit
4
5 class GetCurrentBranchCommitsCommand : AbstractGitCommand<List<RawCommit>>() {
6     override val commandLine: String
7         get() = "git log main..HEAD --no-merges --oneline --pretty=format:\"%an|%s\""
8
9     override fun transform(rawOutput: String): List<RawCommit> =
10         rawOutput
11             .split("\n")
12             .map { it.split("|") }
13             .map { RawCommit(it[0], it[1]) }
14 }