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 `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 branchLevel(): Level = level(
id = "branch",
title = "Branch",
description = "To work on a piece of code that has the potential to break things, create the branch test_code.",
hints = listOf("`git branch` is what you want to investigate."),
commandSuggestions = listOf("git branch test_code"),
setup = { RepoState(initialized = true, files = listOf(GitFile("README", tracked = true)), commits = listOf(CommitNode("0000001", "Initial commit")), branches = mapOf("master" to 1)) },
validator = repoPredicate { repo -> "test_code" in repo.branches && repo.headBranch == "master" },
testCases = listOf(
levelTestCase("create branch", "git branch test_code"),
),
)