Call Git cmd_main directly
This commit is contained in:
@@ -409,34 +409,6 @@ class GitSandboxEngineTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun nativeInteractiveRebaseRewordUsesEditedTodoMessage() {
|
||||
val git = testGitBinary()
|
||||
assumeTrue(git.exists() && git.canExecute())
|
||||
val root = Files.createTempDirectory("githug-reword-editor").toFile()
|
||||
try {
|
||||
val runtime = GitRepositoryRuntime(root, git)
|
||||
val level = renameCommitLevel()
|
||||
val repo = runtime.prepareLevel(level)
|
||||
val invocation = parseGitEditorInvocation("git rebase -i HEAD~2")
|
||||
?: error("Expected interactive rebase editor invocation")
|
||||
val todo = runtime.gitEditorInitialContent(level, repo, invocation)
|
||||
val rewordedTodo = todo.replace(
|
||||
Regex("(?m)^pick (\\S+) First coommit$"),
|
||||
"reword $1 First commit",
|
||||
)
|
||||
|
||||
val (updatedRepo, output) = runtime.executeGitEditorCommand(level, repo, invocation, rewordedTodo)
|
||||
|
||||
assertFalse(output.any { it.contains("error:", ignoreCase = true) || it.contains("fatal:", ignoreCase = true) })
|
||||
assertTrue(updatedRepo.commits.any { it.message == "First commit" })
|
||||
assertFalse(updatedRepo.commits.any { it.message == "First coommit" })
|
||||
assertTrue(level.validator(updatedRepo, invocation.command))
|
||||
} finally {
|
||||
root.deleteRecursively()
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun nativeExecutableShortcutRunsScriptThroughShell() {
|
||||
val git = testGitBinary()
|
||||
|
||||
Reference in New Issue
Block a user