We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 768daee commit 67a7352Copy full SHA for 67a7352
buildSrc/src/main/kotlin/versioning.kt
@@ -15,7 +15,7 @@ fun Project.gitVersion(): String {
15
val lastTag = if (runCommand("git tag", "").isEmpty()) "" else runCommand("git describe --tags --abbrev=0", "")
16
val lastVersion = if (lastTag.isEmpty()) "0.0" else lastTag.substring(1) // remove the leading 'v'
17
val commits = runCommand("git rev-list --count $lastTag..HEAD", "0")
18
- val branch = runCommand("git branch --show-current")
+ val branch = runCommand("git branch --show-current", "master")
19
val gitVersion = lastVersion +
20
(if (branch == "master") "" else "-${branch.replace('/', '.')}") +
21
(if (commits == "0") "" else "-$commits") +
0 commit comments