Skip to content

Commit 61fe37b

Browse files
Will-hxwclaude
andauthored
fix(reviewManager): use pr.base.ref instead of pr.base.name in hasBranch call (#8698)
pr.base.ref is the branch name (e.g., "main") while pr.base.name is the repository name. hasBranch() expects a branch name, so passing pr.base.name would always query refs/heads/<repo-name> which never matches an actual branch. Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
1 parent b98446a commit 61fe37b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/view/reviewManager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,7 @@ export class ReviewManager extends Disposable {
543543
Logger.appendLine('Resolving pull request', this.id);
544544
let pr = await this._folderRepoManager.resolvePullRequest(owner, repositoryName, metadata.prNumber, useCache);
545545

546-
if (!pr || !pr.isResolved() || !(await pr.githubRepository.hasBranch(pr.base.name))) {
546+
if (!pr || !pr.isResolved() || !(await pr.githubRepository.hasBranch(pr.base.ref))) {
547547
await this.clear(true);
548548
this._prNumber = undefined;
549549
Logger.appendLine('This PR is no longer valid', this.id);

0 commit comments

Comments
 (0)