git: add test for commit via staging area

This commit is contained in:
Aleksey Pivovarov
2018-06-24 16:34:22 +03:00
parent 126f5dc2e9
commit bab2021712
2 changed files with 22 additions and 2 deletions
@@ -35,7 +35,7 @@ import java.io.File
import java.util.*
class GitCommitTest : GitSingleRepoTest() {
open class GitCommitTest : GitSingleRepoTest() {
private val myMovementProvider = MyExplicitMovementProvider()
override fun getDebugLogCategories() = super.getDebugLogCategories().plus("#" + GitCheckinEnvironment::class.java.name)
@@ -533,7 +533,7 @@ class GitCommitTest : GitSingleRepoTest() {
fun `test commit rename with conflicting staged rename`() {
`assume version where git reset returns 0 exit code on success `()
assumeTrue(Registry.`is`("git.force.commit.using.staging.area"))
assumeTrue(Registry.`is`("git.force.commit.using.staging.area")) // known bug in "--only" implementation
tac("a.txt", "file content")
@@ -0,0 +1,20 @@
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package git4idea.tests
import com.intellij.openapi.util.registry.Registry
class GitStagingCommitTest : GitCommitTest() {
override fun setUp() {
super.setUp()
Registry.get("git.force.commit.using.staging.area").setValue(true)
}
override fun tearDown() {
try {
Registry.get("git.force.commit.using.staging.area").resetToDefault()
}
finally {
super.tearDown()
}
}
}