дзеркало
https://github.com/l0ng-ai/openidea.git
синхронізовано 2026-12-05 17:47:08 +02:00
fix(github): check out the Review Mode branch in the repository the sync check uses (#6879)
"Update Branch to Enable Review Mode..." ran gh pr checkout in connectedRoot() while the sync check and pull request lookup use reviewRoot() (#6622), so with a worktree or a second clone selected the update acted on another repository and could fail with "refusing to fetch into branch checked out at ...". checkoutPullRequest takes an optional root (default connectedRoot(), so other callers keep theirs); updateReviewBranch captures reviewRoot() before the details reload so a selection change during the reload cannot move the checkout. Co-authored-by: audichuang <[email protected]>
Цей коміт міститься в:
1 джерело
c0b5789dd6
коміт
51b93d25bd
3 files changed
+56
-4
No files matched your search
@@ -67,12 +67,12 @@ export function cancelBusy() {
|
||||
if (b) void commands.cancelRequest(b.request);
|
||||
}
|
||||
|
||||
/** "Checkout Branch": fetches and checks out the pull request's branch (gh's local name). */
|
||||
export async function checkoutPullRequest(number: number): Promise<boolean> {
|
||||
/** "Checkout Branch": fetches and checks out the pull request's branch (gh's local name) in `root`. */
|
||||
export async function checkoutPullRequest(number: number, root: string | null = connectedRoot()): Promise<boolean> {
|
||||
// The command resolves with nothing (`null`), which `withBusy` reports as a failure.
|
||||
const op = { title: tx`Checking out #${number}…`, failure: tx`Couldn't check out #${number}` };
|
||||
const done = await withBusy(op, async (r, out) => {
|
||||
await call(commands.ghPrCheckout(connectedRoot(), r, number, out));
|
||||
await call(commands.ghPrCheckout(root, r, number, out));
|
||||
return true;
|
||||
});
|
||||
if (done === null) return false;
|
||||
|
||||
Reference in new issue
Заблокувати користувача