From 7bffaa422e0da3f165fa817e6778a901a9833d5d Mon Sep 17 00:00:00 2001 From: Axel Niklasson Yun Date: Wed, 1 Apr 2026 14:48:09 +0200 Subject: [PATCH 1/2] Fix shallow clone deepening hanging in CI MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit execSync with stdio: "pipe" created a pipe for stdin, causing git to hang if a credential helper tried to prompt for input. Additionally, execSync blocks the event loop, so the global setTimeout timeout could never fire — leaving no safety net for hanging fetches. Fix by setting stdin to "ignore" (so git can't block on input) and adding a 30s timeout directly on execSync (enforced at OS level via SIGTERM, independent of the event loop). Fixes LIN-62864 Co-Authored-By: Claude Opus 4.6 (1M context) --- src/git.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/git.ts b/src/git.ts index c041c32..07feb99 100644 --- a/src/git.ts +++ b/src/git.ts @@ -227,7 +227,7 @@ export function ensureCommitAvailable(sha: string, cwd: string = process.cwd()): for (const { command, label } of strategies) { verbose(label); try { - execSync(command, { cwd, stdio: "pipe" }); + execSync(command, { cwd, stdio: ["ignore", "ignore", "pipe"], timeout: 30_000 }); if (commitExists(sha, cwd)) { verbose(`Found commit ${sha}`); return; From a07aea49df67e34b7b6bb7570d441442bf7c0b91 Mon Sep 17 00:00:00 2001 From: Axel Niklasson Yun Date: Wed, 1 Apr 2026 14:54:00 +0200 Subject: [PATCH 2/2] Log error --- src/git.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/git.ts b/src/git.ts index 07feb99..ac1ff2f 100644 --- a/src/git.ts +++ b/src/git.ts @@ -232,8 +232,9 @@ export function ensureCommitAvailable(sha: string, cwd: string = process.cwd()): verbose(`Found commit ${sha}`); return; } - } catch { - // Strategy failed, try next + } catch (e) { + const reason = e instanceof Error ? e.message : String(e); + verbose(`Strategy "${label}" failed: ${reason}`); } }