Improve upstream parity for level fixtures
- Add native per-level fixtures for complex histories, tags, branch graphs, rebases, resets, restores, stashes, and local remotes. - Strengthen repository inspection so branch commit counts, remote-tracking branches, and detached tag checkouts reflect real Git state. - Align Fetch, Pull, Push Branch, Branch At, and Rebase validators/tests with upstream-style repository state. - Keep the prompt callout and native filesystem tab-completion fixes from the previous batch.
This commit is contained in:
@@ -13,10 +13,13 @@ internal fun rebaseLevel(): Level = level(
|
||||
description = "We are using a git rebase workflow and the feature branch is ready to go into master. Let's rebase the feature branch onto our master branch.",
|
||||
hints = listOf("You want to research the `git rebase` command"),
|
||||
commandSuggestions = listOf("git checkout feature", "git rebase master"),
|
||||
setup = { RepoState(initialized = true, headBranch = "feature", branches = mapOf("master" to 2, "feature" to 3)) },
|
||||
validator = repoPredicate { repo -> repo.headBranch == "feature" && (repo.branches["feature"] ?: 0) >= (repo.branches["master"] ?: 0) },
|
||||
setup = { RepoState(initialized = true, headBranch = "master", branches = mapOf("master" to 2, "feature" to 2)) },
|
||||
validator = repoPredicate { repo ->
|
||||
repo.headBranch == "feature" &&
|
||||
repo.commits.take(3).map { it.message } == listOf("add feature", "add content", "init commit")
|
||||
},
|
||||
testCases = listOf(
|
||||
levelTestCase("rebase feature on master", "git rebase master"),
|
||||
levelTestCase("checkout then rebase", "git checkout feature", "git rebase master"),
|
||||
levelTestCase("checkout feature then rebase", "git checkout feature", "git rebase master"),
|
||||
levelTestCase("rebase named branch", "git rebase master feature"),
|
||||
),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user