Fix help callout anchoring and Push remote setup

- Anchor startup help callouts inside the scrollable pane workspace so they scroll with the exercise and terminal content they point at.
- Rebuild the Push level remote as a bare sibling repo with a temporary worktree for the remote-only commit, avoiding Android non-bare remote push failures.
- Leave a visible local worktree edit in Push while enabling rebase autostash so status, diff, and pull --rebase all behave as expected.
- Add native Push setup coverage for diverged status output, plain diff output, and clean pull --rebase behavior.
This commit is contained in:
Joe Tretter
2026-05-07 09:57:50 -05:00
parent 91e2df3ffe
commit 565028f64a
5 changed files with 184 additions and 114 deletions

View File

@@ -175,6 +175,30 @@ class GitSandboxEngineTest {
}
}
@Test
fun nativePushLevelHasDivergedStatusAndRebasesCleanly() {
val git = File("/usr/bin/git")
assumeTrue(git.exists() && git.canExecute())
val root = Files.createTempDirectory("githug-push-level").toFile()
try {
val runtime = GitRepositoryRuntime(root, git)
val level = pushLevel()
val repo = runtime.prepareLevel(level)
val (_, statusOutput) = runtime.execute(level, repo, "git status")
assertTrue(statusOutput.any { it.contains("diverged", ignoreCase = true) })
val (_, diffOutput) = runtime.execute(level, repo, "git diff")
assertTrue(diffOutput.isNotEmpty())
val (rebasedRepo, pullOutput) = runtime.execute(level, repo, "git pull --rebase origin master")
assertFalse(pullOutput.any { it.contains("fatal:", ignoreCase = true) || it.contains("error:", ignoreCase = true) })
assertTrue(rebasedRepo.files.any { it.name == "file4" && it.tracked })
} finally {
root.deleteRecursively()
}
}
@Test
fun cdDotDotShortcutMovesToParentDirectory() {
val repo = RepoState(initialized = true, currentDir = "src/main")