We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 963335e commit 4762372Copy full SHA for 4762372
build.gradle.kts
@@ -67,8 +67,11 @@ allprojects {
67
// The ".git" directory may not exist when resolving dependencies in the Docker image build
68
if (File(rootProject.rootDir, ".git").exists()) {
69
val grgit = org.ajoberstar.grgit.Grgit.open(mapOf("currentDir" to rootProject.rootDir))
70
- rootProject.extra["gitHashFull"] = grgit.head().id
71
- rootProject.extra["gitCommitTime"] = grgit.head().dateTime.withZoneSameLocal(java.time.ZoneOffset.UTC)
+ val head = grgit.head()
+ if (head != null) {
72
+ rootProject.extra["gitHashFull"] = head.id
73
+ rootProject.extra["gitCommitTime"] = head.dateTime.withZoneSameLocal(java.time.ZoneOffset.UTC)
74
+ }
75
grgit.close()
76
}
77
0 commit comments