PEP-269: список конфликтующих файлов — git с пределом по времени, эскалация не виснет
All checks were successful
peppa/lint lint: success за 2с
peppa/typecheck typecheck: success за 45с
peppa/build build: success за 32с
peppa/test test: success за 1409с
peppa-ci / ci (pull_request) Successful in 25m29s

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
peppa-bot 2026-11-24 19:24:06 +00:00
parent 4e3dcc4461
commit cb75173562

View File

@ -28,7 +28,7 @@ import {
import { settings, keyPrefix, type Db } from "@peppa/db";
import { asIs, m } from "@peppa/shared/i18n";
import { requestRebase } from "./flow.ts";
import { git } from "./git.ts";
import { credentialHelper, run } from "./git.ts";
import { resolveTaskById } from "./sessions.ts";
type Log = (m: string) => void;
@ -74,6 +74,16 @@ export function setConflictFilesLister(f: FilesLister | null): void {
filesLister = f ?? gitConflictFiles;
}
/** A git call bounded in time: the list of files must never hold the escalation (CI, a slow Gitea). */
const GIT_TIMEOUT_MS = 20_000;
const git = (cwd: string, ...args: string[]) =>
run("git", ["-c", "credential.helper=", "-c", `credential.helper=${credentialHelper()}`, ...args], {
cwd,
timeout: GIT_TIMEOUT_MS,
killSignal: "SIGKILL",
env: { ...process.env, GIT_TERMINAL_PROMPT: "0" },
});
/**
* The files that conflict: fetch both heads into the project's working copy (objects and
* FETCH_HEAD only, the working tree is untouched) and `git merge-tree` them. Null — unknown.