Skip to content

Commit dd547f8

Browse files
Copilotalexr00
andcommitted
Address code review feedback - use immutable GitHubRef update
Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
1 parent 4f4fd0e commit dd547f8

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/github/pullRequestModel.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1220,8 +1220,17 @@ export class PullRequestModel extends IssueModel<PullRequest> implements IPullRe
12201220
});
12211221

12221222
if (data?.updateIssue?.issue) {
1223-
// Update the local base branch reference
1224-
this.base.ref = newBaseBranch;
1223+
// Update the local base branch reference by creating a new GitHubRef instance
1224+
const cloneUrl = this.base.repositoryCloneUrl.toString() || '';
1225+
this.base = new GitHubRef(
1226+
newBaseBranch,
1227+
`${this.base.owner}:${newBaseBranch}`,
1228+
this.base.sha,
1229+
cloneUrl,
1230+
this.base.owner,
1231+
this.base.name,
1232+
this.base.isInOrganization
1233+
);
12251234
this._onDidChange.fire({ base: true });
12261235
}
12271236
Logger.debug(`Updating base branch to ${newBaseBranch} - done`, PullRequestModel.ID);

0 commit comments

Comments
 (0)