Skip to content

Commit 34c4d49

Browse files
authored
Fix create view not updating merge when view is hidden (#8056)
1 parent dd49898 commit 34c4d49

File tree

1 file changed

+15
-21
lines changed

1 file changed

+15
-21
lines changed

src/github/createPRViewProvider.ts

Lines changed: 15 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -634,28 +634,22 @@ export class CreatePullRequestViewProvider extends BaseCreatePullRequestViewProv
634634
}
635635

636636
public async setDefaultCompareBranch(compareBranch: Branch | undefined) {
637-
const branchChanged = compareBranch && (compareBranch.name !== this.model.compareBranch);
638-
const currentCompareRemote = this._folderRepositoryManager.gitHubRepositories.find(repo => repo.remote.owner === this.model.compareOwner)?.remote.remoteName;
639-
const branchRemoteChanged = compareBranch && (compareBranch.upstream?.remote !== currentCompareRemote);
640-
if (branchChanged || branchRemoteChanged) {
641-
this._defaultCompareBranch = compareBranch!.name!;
642-
this.model.setCompareBranch(compareBranch!.name);
643-
this.changeBranch(compareBranch!.name!, false).then(async titleAndDescription => {
644-
const params: Partial<CreateParamsNew> = {
645-
defaultTitle: titleAndDescription.title,
646-
defaultDescription: titleAndDescription.description,
647-
compareBranch: compareBranch?.name,
648-
defaultCompareBranch: compareBranch?.name,
649-
warning: await this.existingPRMessage(),
650-
};
651-
if (!branchRemoteChanged) {
652-
return this._postMessage({
653-
command: 'pr.initialize',
654-
params,
655-
});
656-
}
637+
this._defaultCompareBranch = compareBranch!.name!;
638+
this.model.setCompareBranch(compareBranch!.name);
639+
this.changeBranch(compareBranch!.name!, false).then(async titleAndDescription => {
640+
const params: Partial<CreateParamsNew> = {
641+
defaultTitle: titleAndDescription.title,
642+
defaultDescription: titleAndDescription.description,
643+
compareBranch: compareBranch?.name,
644+
defaultCompareBranch: compareBranch?.name,
645+
warning: await this.existingPRMessage(),
646+
};
647+
return this._postMessage({
648+
command: 'pr.initialize',
649+
params,
657650
});
658-
}
651+
});
652+
659653
}
660654

661655
public override show(compareBranch?: Branch): void {

0 commit comments

Comments
 (0)