Misc Changes

This commit is contained in:
Joe Tretter
2026-05-06 21:28:44 -05:00
parent 5727022baf
commit e1b2d7f7a1
64 changed files with 1662 additions and 300 deletions

View File

@@ -0,0 +1,21 @@
package solutions.tretter.githugandroid
/**
* Port of the upstream ruby-githug `find_old_branch` 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 findOldBranchLevel(): Level = level(
id = "find_old_branch",
title = "Find Old Branch",
description = "You have been working on a branch but got distracted by a major issue. Switch back to that branch even though you forgot the name of it.",
hints = listOf("Ever played with the `git reflog` command?"),
commandSuggestions = listOf("git checkout solve_world_hunger"),
setup = { RepoState(initialized = true, branches = mapOf("master" to 1, "solve_world_hunger" to 2)) },
validator = repoPredicate { repo -> repo.headBranch == "solve_world_hunger" },
testCases = listOf(
levelTestCase("checkout old branch", "git checkout solve_world_hunger"),
),
)