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:
@@ -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"),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user