PEP-269: список конфликтующих файлов — git с пределом по времени, эскалация не виснет
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
4e3dcc4461
commit
cb75173562
@ -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.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user