Also clean newly added files.

Some patches could add new file and after hard reset they are not
deleted. This leads to patch apply failure.

Updated JGit otherwise clean command was not working properly.
This commit is contained in:
Yahor Berdnikau
2023-01-26 21:49:02 +01:00
committed by Space Team
parent 5541d1d8a2
commit ff2de0e2b9
3 changed files with 23 additions and 5 deletions
+12
View File
@@ -2171,6 +2171,12 @@
<sha256 value="b19204331ac6e204befaf508a68f52ec6b4638d9d9bacddbebd435f9c4d500f2" origin="Generated by Gradle"/> <sha256 value="b19204331ac6e204befaf508a68f52ec6b4638d9d9bacddbebd435f9c4d500f2" origin="Generated by Gradle"/>
</artifact> </artifact>
</component> </component>
<component group="com.googlecode.javaewah" name="JavaEWAH" version="1.1.13">
<artifact name="JavaEWAH-1.1.13.jar">
<md5 value="a1eb305e5cc5bba238d4360e3139abb4" origin="Generated by Gradle"/>
<sha256 value="4c0fda2b1d317750d7ea324e36c70b2bc48310c0aaae67b98df0915d696d7111" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="com.googlecode.json-simple" name="json-simple" version="1.1"> <component group="com.googlecode.json-simple" name="json-simple" version="1.1">
<artifact name="json-simple-1.1.jar"> <artifact name="json-simple-1.1.jar">
<md5 value="eb342044fc56be9ba49fbfc9789f1bb5" origin="Generated by Gradle"/> <md5 value="eb342044fc56be9ba49fbfc9789f1bb5" origin="Generated by Gradle"/>
@@ -6416,6 +6422,12 @@
<sha256 value="dabf8369f0cdf8cf17b7f7da4bda9320c570bb754c88e0beb7b852812cf5cd25" origin="Generated by Gradle"/> <sha256 value="dabf8369f0cdf8cf17b7f7da4bda9320c570bb754c88e0beb7b852812cf5cd25" origin="Generated by Gradle"/>
</artifact> </artifact>
</component> </component>
<component group="org.eclipse.jgit" name="org.eclipse.jgit" version="6.4.0.202211300538-r">
<artifact name="org.eclipse.jgit-6.4.0.202211300538-r.jar">
<md5 value="2750720ae43f9cb254e6349080bf9d70" origin="Generated by Gradle"/>
<sha256 value="c1487989eadb53bd58a47b72fb069636397bb8dfedf21387a40a86c3e7b2faac" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.eclipse.sisu" name="org.eclipse.sisu.inject" version="0.3.5"> <component group="org.eclipse.sisu" name="org.eclipse.sisu.inject" version="0.3.5">
<artifact name="org.eclipse.sisu.inject-0.3.5.jar"> <artifact name="org.eclipse.sisu.inject-0.3.5.jar">
<md5 value="1b296b0ddd911ed3750b3df93b395cd5" origin="Generated by Gradle"/> <md5 value="1b296b0ddd911ed3750b3df93b395cd5" origin="Generated by Gradle"/>
@@ -5,7 +5,7 @@ plugins {
dependencies { dependencies {
implementation("org.jetbrains.kotlin:kotlin-scripting-common") implementation("org.jetbrains.kotlin:kotlin-scripting-common")
implementation("com.squareup.okhttp3:okhttp:4.9.0") implementation("com.squareup.okhttp3:okhttp:4.9.0")
implementation("org.eclipse.jgit:org.eclipse.jgit:5.13.0.202109080827-r") implementation("org.eclipse.jgit:org.eclipse.jgit:6.4.0.202211300538-r")
implementation("org.slf4j:slf4j-nop:1.7.32") implementation("org.slf4j:slf4j-nop:1.7.32")
implementation("org.jetbrains.kotlinx:dataframe:0.8.1") implementation("org.jetbrains.kotlinx:dataframe:0.8.1")
} }
@@ -123,19 +123,25 @@ abstract class BenchmarkTemplate(
patch: InputStream patch: InputStream
) { ) {
println("Applying patch $patchName to repository") println("Applying patch $patchName to repository")
Git.open(projectRepoDir) val git = Git.open(projectRepoDir)
.apply() git.apply()
.setPatch(patch) .setPatch(patch)
.call() .call()
git.close()
} }
fun repoReset() { fun repoReset() {
println("Hard resetting project repo") println("Hard resetting project repo")
Git.open(projectRepoDir) val git = Git.open(projectRepoDir)
.reset() git.reset()
.setMode(ResetCommand.ResetType.HARD) .setMode(ResetCommand.ResetType.HARD)
.setProgressMonitor(gitOperationsPrinter) .setProgressMonitor(gitOperationsPrinter)
.call() .call()
git.clean()
.setCleanDirectories(true)
.setForce(true)
.call()
git.close()
} }
private fun runBenchmark( private fun runBenchmark(