Fixes GitHub PR/issue context endpoints returning 404 when working from a fork because they resolved the repo from origin remote only. - Pass sourceRepo: status?.repo ?? null to all prContext() calls in PullRequestSection.tsx (5 call sites) - Pass sourceRepo: args.pr.sourceRepo ?? null / args.issue.sourceRepo ?? null to NewWorktreeDialog.tsx (3 call sites: prContext, issueGet, issueComments) - Add status?.repo to dependency arrays to prevent stale closures The prStatus endpoint already resolves the correct repo through the fork network; this change wires it through to the downstream API calls. Closes #2090 Co-authored-by: bashrusakh <bashrusakh@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
co-authored by
bashrusakh
parent
cd1ffa8b66
commit
d01126cf3c
@@ -496,12 +496,12 @@ export function NewWorktreeDialog({
|
||||
return;
|
||||
}
|
||||
|
||||
const issueRes = await github.issueGet(projectDirectory, args.issue.number);
|
||||
const issueRes = await github.issueGet(projectDirectory, args.issue.number, { sourceRepo: args.issue.sourceRepo ?? null });
|
||||
if (issueRes.connected === false || !issueRes.repo || !issueRes.issue) {
|
||||
throw new Error('Failed to load issue context');
|
||||
}
|
||||
|
||||
const commentsRes = await github.issueComments(projectDirectory, args.issue.number);
|
||||
const commentsRes = await github.issueComments(projectDirectory, args.issue.number, { sourceRepo: args.issue.sourceRepo ?? null });
|
||||
if (commentsRes.connected === false) {
|
||||
throw new Error('Failed to load issue comments');
|
||||
}
|
||||
@@ -542,6 +542,7 @@ export function NewWorktreeDialog({
|
||||
}
|
||||
|
||||
const prContext = await github.prContext(projectDirectory, args.pr.number, {
|
||||
sourceRepo: args.pr.sourceRepo ?? null,
|
||||
includeDiff: args.includeDiff,
|
||||
includeCheckDetails: false,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user