MCPcopy Create free account
hub / github.com/Kilo-Org/cloud / getCurrentBranch

Function getCurrentBranch

services/cloud-agent-next/wrapper/src/utils.ts:326–348  ·  view source on GitHub ↗
(
  workspacePath: string,
  timeoutMs?: number,
  signal?: AbortSignal
)

Source from the content-addressed store, hash-verified

324 }
325
326 if (opts?.signal) {
327 if (opts.signal.aborted) {
328 terminate('abort');
329 } else {
330 opts.signal.addEventListener('abort', abortHandler, { once: true });
331 }
332 }
333 let finishing = false;
334 proc.on('close', (code, signal) => {
335 if (settled || finishing) return;
336 if (terminationReason !== null) {
337 waitForTerminatedGroup();
338 return;
339 }
340 finishing = true;
341 clearTimers();
342 removeAbortHandler();
343 const exitCode = code ?? (signal === null ? 0 : 1);
344 const complete = (): void => {
345 if (settled) return;
346 settled = true;
347 resolve({
348 stdout,
349 stderr,
350 exitCode,
351 elapsedMs: Date.now() - startedAt,

Callers 2

runAutoCommitFunction · 0.85
triggerDrainAndCloseFunction · 0.85

Calls 1

gitFunction · 0.85

Tested by

no test coverage detected