Skip to content

Commit 440e16c

Browse files
Copilotalexr00
andcommitted
Check for conflicts in isUpdateBranchWithGitHubEnabled
Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
1 parent 0b78816 commit 440e16c

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/github/pullRequestOverview.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import {
1717
ITeam,
1818
MergeMethod,
1919
MergeMethodsAvailability,
20+
PullRequestMergeability,
2021
ReviewEventEnum,
2122
ReviewState,
2223
} from './interface';
@@ -221,7 +222,11 @@ export class PullRequestOverviewPanel extends IssueOverviewPanel<PullRequestMode
221222

222223
private isUpdateBranchWithGitHubEnabled(): boolean {
223224
// With the GraphQL UpdatePullRequestBranch API, we can update branches even when not checked out
224-
// (as long as there are no conflicts). The conflict check is done in updateBranch().
225+
// (as long as there are no conflicts). If there are conflicts, we need the branch to be checked out.
226+
const hasConflicts = this._item.item.mergeable === PullRequestMergeability.Conflict;
227+
if (hasConflicts) {
228+
return this._item.isActive;
229+
}
225230
return true;
226231
}
227232

0 commit comments

Comments
 (0)