Skip to content

Commit d6256d2

Browse files
committed
Merge pull request #160 from mbeddr/bugfix/main_vs_master_branch
2 parents 896925d + e070f8a commit d6256d2

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

git-based-versioning/CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
# 1.0.0
22

33
Initial version, extracted from `mps-gradle-plugin`.
4+
5+
# 1.1.0
6+
7+
Not only the 'master' prefix but also the 'main' prefix is now stripped when deriving the version identifier.

git-based-versioning/build.gradle.kts

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ plugins {
44
}
55

66
group = "de.itemis.mps.gradle"
7-
version = "1.0"
7+
version = "1.1.0"
88

99
dependencies {
1010
implementation(gradleApi())

git-based-versioning/src/main/groovy/de/itemis/mps/gradle/GitBasedVersioning.groovy

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ class GitBasedVersioning {
8686
static String getVersion(String branch, String major, String minor, String bugfix = "", int count) {
8787
def hash = getGitShortCommitHash()
8888
def baseVersion = bugfix.isEmpty() ? "$major.$minor.$count.$hash" : "$major.$minor.$bugfix.$count.$hash"
89-
if (branch == 'master' || branch == 'HEAD' /*this happens in detached head situations*/) {
89+
if (branch == 'master' || branch == 'main' || branch == 'HEAD' /*this happens in detached head situations*/) {
9090
return baseVersion
9191
}
9292

0 commit comments

Comments
 (0)