MCPcopy Create free account
hub / github.com/Kilo-Org/cloud / appendCommitCoAuthor

Function appendCommitCoAuthor

services/cloud-agent-next/wrapper/src/auto-commit.ts:17–33  ·  view source on GitHub ↗
(
  commitMessage: string,
  commitCoAuthor: WrapperCommitCoAuthor | undefined
)

Source from the content-addressed store, hash-verified

15const worktreeAutoCommits = new Map<string, Promise<void>>();
16const COMMIT_EVIDENCE_TIMEOUT_MS = 5_000;
17
18type CommitEvidence = {
19 commitHash: string;
20 commitMessage?: string;
21 committedAt?: string;
22 commitMessageTruncated?: true;
23};
24type PushStatus = 'failed' | 'not_attempted' | 'unknown';
25
26function appendCommitCoAuthor(
27 commitMessage: string,
28 commitCoAuthor: WrapperCommitCoAuthor | undefined
29): string {
30 if (!commitCoAuthor) return commitMessage;
31 if (
32 /[\r\n<>]/.test(commitCoAuthor.name) ||
33 /[\r\n<>]/.test(commitCoAuthor.email) ||
34 commitCoAuthor.email.trim() !== commitCoAuthor.email
35 ) {
36 writeLog('auto-commit: ignoring invalid commit co-author identity');

Callers 1

runAutoCommitFunction · 0.85

Calls 1

logToFileFunction · 0.85

Tested by

no test coverage detected