chore(autoversion): clean up leftovers from previous approach
All checks were successful
ci/woodpecker/push/gradle Pipeline was successful
ci/woodpecker/push/pages Pipeline was successful

This commit is contained in:
Johannes Frohnmeyer 2024-05-26 11:05:05 +02:00
parent 8decdad746
commit d095a18b2b
Signed by: Johannes
GPG Key ID: E76429612C2929F4
2 changed files with 1 additions and 37 deletions

View File

@ -1,29 +0,0 @@
package io.gitlab.jfronny.scripts
import java.lang.reflect.Field
import java.util.*
private val processEnvironmentClass: Class<*> = Class.forName("java.lang.ProcessEnvironment")
private val theEnvironmentField: Field = processEnvironmentClass.getDeclaredField("theEnvironment").apply { isAccessible = true }
private val theCaseInsensitiveEnvironmentField: Field = processEnvironmentClass.getDeclaredField("theCaseInsensitiveEnvironment").apply { isAccessible = true }
@Throws(Exception::class)
fun setEnv(newenv: Map<String, String>?) = try {
val env = theEnvironmentField.get(null) as MutableMap<String, String>
env.clear()
env.putAll(newenv!!)
val cienv = theCaseInsensitiveEnvironmentField.get(null) as MutableMap<String, String>
cienv.clear()
cienv.putAll(newenv)
} catch (e: NoSuchFieldException) {
val classes = Collections::class.java.declaredClasses
val env = System.getenv()
for (cl in classes) {
if ("java.util.Collections\$UnmodifiableMap" == cl.name) {
val field: Field = cl.getDeclaredField("m").apply { isAccessible = true }
val map = field.get(env) as MutableMap<String, String>
map.clear()
map.putAll(newenv!!)
}
}
}

View File

@ -25,14 +25,7 @@ fun initializeGit() {
override fun getCurrentTime(): Long = original.currentTime
override fun getTimezone(`when`: Long): Int = original.getTimezone(`when`)
})
// Stuff
// val backup = HashMap(System.getenv())
// setEnv(mapOf())
// try {
org.eclipse.jgit.util.FS.DETECTED.gitSystemConfig
// } finally {
// setEnv(backup)
// }
FS.DETECTED.gitSystemConfig
}
fun Git.log(since: AnyObjectId? = null, until: AnyObjectId? = null): List<Commit> {