Tighten Rm level validation

- Require the Rm level to stage or remove the tracked deleted file instead of treating the initial deleted worktree state as solved.
- Add a regression test proving read-only commands such as `ls` do not complete the Rm level.
- Verify the full JVM level solution suite with the compiled host Git runtime.
This commit is contained in:
Joe Tretter
2026-05-07 16:51:43 -05:00
parent 6444ad07c6
commit 434bd8d97d
3 changed files with 16 additions and 3 deletions

View File

@@ -14,7 +14,10 @@ internal fun rmLevel(): Level = level(
hints = emptyList(),
commandSuggestions = listOf("git status", "git rm deleteme.rb"),
setup = { RepoState(initialized = true, files = listOf(GitFile("deleteme.rb", tracked = true, deleted = true)), commits = listOf(CommitNode("0000001", "Added a temp file")), branches = mapOf("master" to 1)) },
validator = repoPredicate { repo -> repo.files.none { it.name == "deleteme.rb" && !it.deleted } || repo.files.any { it.name == "deleteme.rb" && it.deleted && it.staged } },
validator = repoPredicate { repo ->
repo.files.none { it.name == "deleteme.rb" } ||
repo.files.any { it.name == "deleteme.rb" && it.deleted && it.staged }
},
testCases = listOf(
levelTestCase("git rm deleted path", "git rm deleteme.rb"),
),