- show Git editor file paths instead of the submitted git command - surface follow-up commit message editors during interactive rebase reword - add rename-commit UI tests for editor and amend-message solution paths - add broader embedded level solution scenarios for alternate Git workflows
23 lines
1.2 KiB
Kotlin
23 lines
1.2 KiB
Kotlin
package solutions.tretter.githugandroid
|
|
|
|
/**
|
|
* Port of the upstream ruby-githug `rm_cached` 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 rmCachedLevel(): Level = level(
|
|
id = "rm_cached",
|
|
title = "Rm Cached",
|
|
description = "A file has accidentally been added to your staging area. Identify and remove it from the staging area. *NOTE* Do not remove the file from the file system, only from git.",
|
|
hints = listOf("You may need to use more than one command to complete this."),
|
|
commandSuggestions = listOf("git status", "git rm --cached deleteme.rb"),
|
|
setup = { RepoState(initialized = true, files = listOf(GitFile("deleteme.rb", staged = true), GitFile(".gitignore", staged = true)), branches = mapOf("master" to 0)) },
|
|
validator = repoPredicate { repo -> repo.files.any { it.name == "deleteme.rb" && !it.staged && !it.tracked && !it.deleted } },
|
|
testCases = listOf(
|
|
levelTestCase("rm cached", "git rm --cached deleteme.rb"),
|
|
levelTestCase("reset staged path", "git reset deleteme.rb"),
|
|
),
|
|
)
|