Misc Changes
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
package solutions.tretter.githugandroid
|
||||
|
||||
/**
|
||||
* Port of the upstream ruby-githug `revert` level.
|
||||
*
|
||||
* Setup documents the repository shape the learner explores. Evaluation is kept
|
||||
* state-based whenever the exercise changes repository objects; answer-only
|
||||
* levels intentionally validate the answer entered at the prompt.
|
||||
*/
|
||||
internal fun revertLevel(): Level = level(
|
||||
id = "revert",
|
||||
title = "Revert",
|
||||
description = "You have committed several times but want to undo the middle commit. All commits have been pushed, so you can't change existing history.",
|
||||
hints = listOf("Try the revert command."),
|
||||
commandSuggestions = listOf("git revert HEAD~1"),
|
||||
setup = { RepoState(initialized = true, commits = listOf(CommitNode("1", "First commit"), CommitNode("2", "Bad commit"), CommitNode("3", "Second commit")), branches = mapOf("master" to 3), pushedBranches = setOf("origin/master")) },
|
||||
validator = repoPredicate { repo -> repo.commits.any { it.message.startsWith("Revert") } },
|
||||
testCases = listOf(
|
||||
levelTestCase("revert middle commit", "git revert HEAD~1"),
|
||||
),
|
||||
)
|
||||
Reference in New Issue
Block a user