File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
ng-dev/pr/merge/strategies Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ import {FatalMergeToolError, MergeConflictsFatalError} from '../failures.js';
1717import { Prompt } from '../../../utils/prompt.js' ;
1818import { AutosquashMergeStrategy } from './autosquash-merge.js' ;
1919import { Commit , parseCommitMessage } from '../../../commit-message/parse.js' ;
20+ import { TEMP_PR_HEAD_BRANCH } from './strategy.js' ;
2021
2122/** Type describing the parameters for the Octokit `merge` API endpoint. */
2223type OctokitMergeParams = RestEndpointMethodTypes [ 'pulls' ] [ 'merge' ] [ 'parameters' ] ;
@@ -154,6 +155,11 @@ export class GithubApiMergeStrategy extends AutosquashMergeStrategy {
154155 ) ;
155156 }
156157
158+ // Workaround for fatal: refusing to fetch into branch 'refs/heads/merge_pr_target_main' checked out at ...
159+ // Cannot find where but `merge_pr_target_main` is being set as the current branch.
160+ // TODO: remove after finding the root cause.
161+ this . git . run ( [ 'checkout' , TEMP_PR_HEAD_BRANCH ] ) ;
162+
157163 // Refresh the target branch the PR has been merged into through the API. We need
158164 // to re-fetch as otherwise we cannot cherry-pick the new commits into the remaining
159165 // target branches. Also, this is needed fo the merge comment to get the correct commit SHA.
You can’t perform that action at this time.
0 commit comments