implemented 10-cli-commands.md: added CLI commands for branch name resolution, one-shot builds, failed build retries, and build status reports; includes tests for functionality and edge cases

This commit is contained in:
Michael Hoennig
2026-07-07 13:19:29 +02:00
parent a6a2c9de0b
commit 73221a8b8b
19 changed files with 943 additions and 2 deletions
@@ -0,0 +1,30 @@
package de.hoennig.gittally.commands
import io.kotest.core.spec.style.FunSpec
import io.kotest.matchers.shouldBe
class BranchNameResolutionTest : FunSpec() {
private val candidates = listOf("main", "main-backup", "feature/login", "feature/logout", "hotfix/1.2.3")
init {
test("a unique fragment resolves to the full branch name") {
BranchNameResolution.resolve("login", candidates) shouldBe
BranchNameResolution.Resolved("feature/login")
}
test("an exact branch name wins even when other branches contain it") {
BranchNameResolution.resolve("main", candidates) shouldBe
BranchNameResolution.Resolved("main")
}
test("an ambiguous fragment reports all matching candidates") {
BranchNameResolution.resolve("feature/log", candidates) shouldBe
BranchNameResolution.Ambiguous(listOf("feature/login", "feature/logout"))
}
test("a fragment without any match reports no match") {
BranchNameResolution.resolve("release", candidates) shouldBe
BranchNameResolution.NoMatch
}
}
}