/** * One visit of a `commit` node: the message an earlier node wrote, committed * by our code on the run's own branch. * * The model wrote a text; the act is here, through the `git` port, which has * no push. The run owns one branch, opened by its first commit and held to by * every later one: a later commit finding `HEAD` elsewhere refuses rather * than committing onto somebody else's branch. */ import type { GitPort } from "../../git/index.ts"; import type { CheckedCommitNode } from "../checked.ts"; import { type Visited } from "./ended.ts"; import type { Journal } from "./journal.ts"; import type { Here } from "./walk.ts"; /** How a commit ended: made, or not on a clean tree, on the run's branch; or refused by git. */ export type CommitOutcome = { readonly ok: true; readonly committed: boolean; readonly sha?: string; readonly branch: string; } | { readonly ok: false; readonly kind: "unavailable"; readonly message: string; }; /** What a commit visit needs from the run around it. */ export type CommittingRun = { /** Commits the working tree with `message`, for the visit `path` of `node`. */ commit(node: CheckedCommitNode, path: string, message: string): Promise; }; /** Visits `node` at `path`. A message that is empty, or absent, fails before git is asked anything. */ export declare function visitCommit(run: CommittingRun, node: CheckedCommitNode, path: string, here: Here): Promise; /** * The commits of one real run, in `cwd`: the first opens the run's branch, * `combo/`, written to `journal`, and each later one checks * `HEAD` is still on it. A resumed run holds to the `opened` one. */ export declare function committer(git: GitPort, cwd: string, input: unknown, journal: Journal, opened?: string): (message: string) => Promise; //# sourceMappingURL=commit.d.ts.map