Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

fix: pin the safe Git timeout result contract

[._.]/ Adam Eivy1e4d3f6cd5a8
diff --git a/server/lib/execGit.test.js b/server/lib/execGit.test.js
index d752c3a4d5..5e2b75a0ab 100644
--- a/server/lib/execGit.test.js
+++ b/server/lib/execGit.test.js
@@ -6,7 +6,7 @@ vi.mock('./childProcess.js', () => ({
}));
import { spawn } from './childProcess.js';
-import { execGit } from './execGit.js';
+import { execGit, execGitSafe } from './execGit.js';
const makeChild = () => {
const child = new EventEmitter();
@@ -83,6 +83,18 @@ describe('execGit', () => {
expect(child.kill).toHaveBeenCalled();
});
+ it('execGitSafe converts a timeout into a complete failed result even with ignoreExitCode', async () => {
+ const child = makeChild();
+ spawn.mockReturnValue(child);
+ const promise = execGitSafe(['fetch'], '/repo', { timeout: 500, ignoreExitCode: true });
+ vi.advanceTimersByTime(500);
+ await expect(promise).resolves.toEqual({
+ exitCode: 1,
+ stdout: '',
+ stderr: 'git command timed out after 0.5s: git fetch'
+ });
+ });
+
it('rejects when output exceeds maxBuffer', async () => {
const child = makeChild();
spawn.mockReturnValue(child);