Skip to content

Commit c465bb8

Browse files
sergeibbbeamodio
authored andcommitted
Stops open creating PRs from a branch to itself
(#4709, #4734)
1 parent d992c54 commit c465bb8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/quickpicks/remoteProviderPicker.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,9 @@ export class CopyOrOpenRemoteCommandQuickPickItem extends CommandQuickPickItem {
6262
}
6363
} else if (resource.type === RemoteResourceType.CreatePullRequest) {
6464
let branch = resource.base.branch;
65-
if (branch == null) {
65+
const sameBranchMergeAttempt =
66+
branch === resource.head.branch && this.remote.url === resource.head.remote.url;
67+
if (branch == null || sameBranchMergeAttempt) {
6668
branch = await getDefaultBranchName(Container.instance, this.remote.repoPath, this.remote.name);
6769
if (branch) {
6870
branch = getBranchNameWithoutRemote(branch);

0 commit comments

Comments
 (0)