We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 67a7352 commit 5dc74e2Copy full SHA for 5dc74e2
buildSrc/src/main/kotlin/versioning.kt
@@ -17,7 +17,7 @@ fun Project.gitVersion(): String {
17
val commits = runCommand("git rev-list --count $lastTag..HEAD", "0")
18
val branch = runCommand("git branch --show-current", "master")
19
val gitVersion = lastVersion +
20
- (if (branch == "master") "" else "-${branch.replace('/', '.')}") +
+ (if (branch == "master" || branch.isEmpty()) "" else "-${branch.replace('/', '.')}") +
21
(if (commits == "0") "" else "-$commits") +
22
(if (gitClean()) "" else "-dirty")
23
0 commit comments