Skip to content

Commit 6d43fac

Browse files
Copilotalexr00
andcommitted
Use explicit mergeable state check for GraphQL branch update
Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
1 parent 5e2072c commit 6d43fac

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

src/github/pullRequestModel.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1208,9 +1208,10 @@ export class PullRequestModel extends IssueModel<PullRequest> implements IPullRe
12081208

12091209
Logger.debug(`Updating branch ${model.prHeadBranchName} to ${model.prBaseBranchName} - enter`, GitHubRepository.ID);
12101210

1211-
// When there are no conflicts, use the GitHub GraphQL API's UpdatePullRequestBranch mutation
1212-
// This is simpler and more efficient than manually creating trees and commits
1213-
if (this.item.mergeable !== PullRequestMergeability.Conflict) {
1211+
// When there are no conflicts, use the GitHub GraphQL API's UpdatePullRequestBranch mutation.
1212+
// This is simpler and more efficient than manually creating trees and commits.
1213+
// The GraphQL API is suitable for Mergeable and Behind states, which can be cleanly updated.
1214+
if (this.item.mergeable === PullRequestMergeability.Mergeable || this.item.mergeable === PullRequestMergeability.Behind) {
12141215
return this.updateBranchWithGraphQL();
12151216
}
12161217

0 commit comments

Comments
 (0)