Restore Diff level working-tree change
- Add a dedicated native Diff fixture that commits baseline app.rb content and leaves an unstaged line-26 change from data.json to server.json. - Update the Diff level setup metadata so app.rb is no longer represented as an empty file. - Add a native runtime regression for `git diff` showing the expected line-26 hunk.
This commit is contained in:
@@ -209,6 +209,29 @@ class GitSandboxEngineTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun nativeDiffLevelShowsLine26Change() {
|
||||
val git = testGitBinary()
|
||||
assumeTrue(git.exists() && git.canExecute())
|
||||
val root = Files.createTempDirectory("githug-diff-level").toFile()
|
||||
try {
|
||||
val runtime = GitRepositoryRuntime(root, git)
|
||||
val level = diffLevel()
|
||||
val repo = runtime.prepareLevel(level)
|
||||
|
||||
val appFile = repo.files.single { it.name == "app.rb" }
|
||||
assertTrue(appFile.content.contains("server.json"))
|
||||
|
||||
val (_, diffOutput) = runtime.execute(level, repo, "git diff")
|
||||
|
||||
assertTrue(diffOutput.any { it.contains("- @message = get_response('data.json')") })
|
||||
assertTrue(diffOutput.any { it.contains("+ @message = get_response('server.json')") })
|
||||
assertTrue(diffOutput.any { it.contains("@@ -23,7 +23,7 @@") })
|
||||
} finally {
|
||||
root.deleteRecursively()
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cdDotDotShortcutMovesToParentDirectory() {
|
||||
val repo = RepoState(initialized = true, currentDir = "src/main")
|
||||
|
||||
Reference in New Issue
Block a user