Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions extensions/yolo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ export default function yolo(pi: ExtensionAPI) {
encoding: "utf8",
timeout: 2000,
windowsHide: true,
stdio: ["ignore", "pipe", "ignore"],
}).trim();
} catch {
return null;
Expand All @@ -158,14 +159,15 @@ export default function yolo(pi: ExtensionAPI) {
*/
function gitCheckpoint(cwd: string, now: number): CheckpointResult {
const runGit = (args: string[]): string =>
execFileSync("git", args, { cwd, encoding: "utf8", timeout: 5000, windowsHide: true }).toString();
execFileSync("git", args, { cwd, encoding: "utf8", timeout: 5000, windowsHide: true, stdio: ["ignore", "pipe", "ignore"] }).toString();
const result = decideCheckpoint(runGit);
if ("sha" in result) {
try {
execFileSync("git", ["update-ref", `refs/pify/yolo/${now}`, result.sha], {
cwd,
timeout: 5000,
windowsHide: true,
stdio: ["ignore", "pipe", "ignore"],
});
} catch {
// unreachable-but-recent commits still survive the default gc window
Expand Down Expand Up @@ -381,7 +383,7 @@ Go ahead anyway?`));
function releaseRefs(cwd: string, refs: string[]): void {
for (const ref of refs) {
try {
execFileSync("git", ["update-ref", "-d", ref], { cwd, timeout: 5000, windowsHide: true });
execFileSync("git", ["update-ref", "-d", ref], { cwd, timeout: 5000, windowsHide: true, stdio: ["ignore", "pipe", "ignore"] });
} catch {
// already gone, or not a repo any more
}
Expand Down Expand Up @@ -926,6 +928,7 @@ Go ahead anyway?`));
cwd: ctx.cwd,
timeout: 30_000,
windowsHide: true,
stdio: ["ignore", "pipe", "ignore"],
});
ctx.ui.notify(`Working tree restored to ${point.treeSha?.slice(0, 8)}.`, "info");
} catch (err) {
Expand Down