MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / readPullRequest

Function readPullRequest

apps/kimi-code/src/utils/git/git-status.ts:245–274  ·  view source on GitHub ↗
(workDir: string)

Source from the content-addressed store, hash-verified

243}
244
245function readPullRequest(workDir: string): Promise<PullRequestInfo | null> {
246 return new Promise((resolve) => {
247 try {
248 execFile(
249 'gh',
250 ['pr', 'view', '--json', 'number,url'],
251 {
252 cwd: workDir,
253 encoding: 'utf8',
254 env: {
255 ...process.env,
256 GH_NO_UPDATE_NOTIFIER: '1',
257 GH_PROMPT_DISABLED: '1',
258 },
259 timeout: PR_SPAWN_TIMEOUT_MS,
260 maxBuffer: 256 * 1024,
261 },
262 (error, stdout) => {
263 if (error !== null) {
264 resolve(null);
265 return;
266 }
267 resolve(parsePullRequest(stdout));
268 },
269 );
270 } catch {
271 resolve(null);
272 }
273 });
274}
275
276function samePullRequest(a: PullRequestInfo | null, b: PullRequestInfo | null): boolean {
277 if (a === null || b === null) return a === b;

Callers 1

Calls 2

parsePullRequestFunction · 0.70
resolveFunction · 0.50

Tested by

no test coverage detected