package solutions.tretter.githugandroid

/**
 * Port of the upstream ruby-githug `repack` 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 repackLevel(): Level = level(
    id = "repack",
    title = "Repack",
    description = "Optimise how your repository is packaged ensuring that redundant packs are removed.",
    hints = listOf("You want to research the `git repack` command."),
    commandSuggestions = listOf("git repack -d"),
    setup = { RepoState(initialized = true, files = listOf(GitFile("foo", tracked = true)), commits = listOf(CommitNode("1", "Added foo")), branches = mapOf("master" to 1)) },
    validator = repoPredicate { repo -> "repack" in repo.maintenanceActions },
    testCases = listOf(
        levelTestCase("repack delete redundant packs", "git repack -d"),
        levelTestCase("repack all", "git repack -a -d"),
    ),
)
