Skip to content

Commit 75696c9

Browse files
committed
fix: VERSIONING_GIT_TAG will simulate no branch
1 parent 17715a6 commit 75696c9

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ plugins {
1111
}
1212

1313
group 'me.qoomon'
14-
version '1.2.2'
14+
version '1.2.3'
1515

1616
sourceCompatibility = JavaVersion.VERSION_1_8
1717
targetCompatibility = JavaVersion.VERSION_1_8

src/main/java/me/qoomon/gradle/gitversioning/GitVersioningPlugin.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,15 @@ public void apply(@Nonnull Project rootProject) {
2626
rootProject.afterEvaluate(evaluatedProject -> {
2727

2828
GitRepoSituation repoSituation = GitUtil.situation(rootProject.getProjectDir());
29-
String providedBranch = getOption(rootProject, "git.branch");
30-
if (providedBranch != null) {
31-
repoSituation.setHeadBranch(providedBranch.isEmpty() ? null : providedBranch);
32-
}
3329
String providedTag = getOption(rootProject, "git.tag");
3430
if (providedTag != null) {
31+
repoSituation.setHeadBranch(null);
3532
repoSituation.setHeadTags(providedTag.isEmpty() ? emptyList() : singletonList(providedTag));
3633
}
34+
String providedBranch = getOption(rootProject, "git.branch");
35+
if (providedBranch != null) {
36+
repoSituation.setHeadBranch(providedBranch.isEmpty() ? null : providedBranch);
37+
}
3738

3839
GitVersionDetails gitVersionDetails = GitVersioning.determineVersion(repoSituation,
3940
ofNullable(config.commit)

0 commit comments

Comments
 (0)