package solutions.tretter.githugandroid

/**
 * Port of the upstream ruby-githug `stash` 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 stashLevel(): Level = level(
    id = "stash",
    title = "Stash",
    description = "You've made some changes and want to work on them later. You should save them, but don't commit them.",
    hints = listOf("It's like stashing. Try finding an appropriate git command."),
    commandSuggestions = listOf("git stash", "git status"),
    setup = { RepoState(initialized = true, files = listOf(GitFile("lyrics.txt", "modified lyrics", tracked = true)), commits = listOf(CommitNode("0000001", "Initial commit")), branches = mapOf("master" to 1)) },
    validator = repoPredicate { repo -> repo.stashes.isNotEmpty() && repo.files.none { it.staged } },
    testCases = listOf(
        levelTestCase("stash changes", "git stash"),
    ),
)
