Call Git cmd_main directly

This commit is contained in:
Joe Tretter
2026-06-24 13:16:35 -05:00
parent a9d7b0cfc0
commit 0554c736e4
26 changed files with 1141 additions and 661 deletions

View File

@@ -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()