=> {
const sha = commit.commitSha;
const inner = `applied live · ${escape(resolved.title)}
Your edit to ${escape(resolved.pageUrl)} is now live and committed.
Commit ${escape(shortSha(sha))}
landed in the local bare repo (/app/repo in the container,
~/repos/tdd.md.git on p620) via git plumbing.
No HTTP, no Forgejo, no SSH involved — just a real git commit on disk.
The container's content/ dir is copied from the working
tree at image build, and the next deploy fetches new commits from the
local bare repo before rebuilding — so this commit will outlive any
container restart.
→ view the live page · edit again
`;
return renderPage({
title: `applied · ${resolved.title} — tdd.md`,
bodyHtml: layoutWrap(inner),
noindex: true,
bodyClass: editBodyClass,
});
};
// -------- admin commit failed (Forgejo conflict / network / other) --------
export const renderEditCommitFailed = async (
resolved: ResolvedEdit,
failure: GitCommitFailure,
): Promise => {
const explanation =
failure.kind === "conflict"
? "The branch tip moved while you were editing — someone else committed in between. Refresh the editor to load the latest version, then re-apply your change."
: failure.kind === "permission"
? "The container can't write to the bare repo. Check that /home/scri/repos/tdd.md.git on p620 is mounted read-write into /app/repo."
: failure.kind === "not_found"
? "The 'main' branch doesn't exist in the bare repo. Verify that ~/repos/tdd.md.git on p620 has a refs/heads/main."
: "git rejected the commit for an unexpected reason. See the message below.";
const inner = `commit failed · ${escape(resolved.title)}
Your edit to ${escape(resolved.pageUrl)} was not applied. The live page is unchanged.
git returned ${escape(failure.kind)}.
${escape(explanation)}
git stderr
${escape(failure.message.slice(0, 2000))}
← back to the editor (refreshes the form)
`;
return renderPage({
title: `commit failed · ${resolved.title} — tdd.md`,
bodyHtml: layoutWrap(inner),
noindex: true,
bodyClass: editBodyClass,
});
};