MCPcopy Create free account
hub / github.com/angular/dev-infra / _assertMergeableOrThrow

Function _assertMergeableOrThrow

ng-dev/pr/merge/strategies/strategy.ts:191–202  ·  view source on GitHub ↗

Asserts that given pull request could be merged into the given target branches.

(
    {revisionRange}: PullRequest,
    targetBranches: string[],
  )

Source from the content-addressed store, hash-verified

189 cherryPickArgs.push('-x');
190 }
191
192 // Cherry-pick the refspec into all determined target branches.
193 for (const branchName of targetBranches) {
194 const localTargetBranch = this.getLocalTargetBranchName(branchName);
195 // Checkout the local target branch.
196 this.git.run(['checkout', localTargetBranch]);
197 // Cherry-pick the refspec into the target branch.
198 const cherryPickResult = this.git.runGraceful(['cherry-pick', ...cherryPickArgs]);
199 if (cherryPickResult.status !== 0) {
200 // Abort the failed cherry-pick. We do this because Git persists the failed
201 // cherry-pick state globally in the repository. This could prevent future
202 // pull request merges as a Git thinks a cherry-pick is still in progress.
203 this.git.runGraceful(['cherry-pick', '--abort']);
204 failedBranches.push(branchName);
205 }

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected