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
@@ -151,6 +151,15 @@ class GitService(
.trim()
.ifEmpty { null }
/** The commit `refs/heads/[branch]` points at, or null when there is no such local branch. */
fun localHeadCommit(
branch: String,
workingDir: Path = Paths.get("."),
): String? {
val result = runner.run(listOf("git", "rev-parse", "--verify", "refs/heads/$branch"), workingDir)
return if (result.isSuccess) result.stdout.trim() else null
}
/** The commit `refs/remotes/origin/[branch]` points at, or null when the branch is not on origin. */
fun originHeadCommit(
branch: String,