File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -181,7 +181,7 @@ async function setupWorkingBranch(context: GitHubContext, octokit: Octokits): Pr
181181
182182 if ( useExistingBranch ) {
183183 try {
184- await $ `git checkout ${ sourceBranch } ` ;
184+ await $ `git checkout -B ${ sourceBranch } origin/ ${ sourceBranch } ` ;
185185
186186 console . log ( `✓ Successfully checked out PR branch for PR #${ entityNumber } ` ) ;
187187
@@ -220,7 +220,7 @@ async function setupWorkingBranch(context: GitHubContext, octokit: Octokits): Pr
220220 return await createNewBranch ( baseBranch , branchName , prBaseBranch )
221221 }
222222
223- await $ `git checkout ${ baseBranch } ` ;
223+ await $ `git checkout -B ${ baseBranch } origin/ ${ baseBranch } ` ;
224224
225225 return {
226226 baseBranch : baseBranch ,
@@ -243,7 +243,7 @@ export async function ensureBranchHistory(branch: string, depth?: number) {
243243 console . log ( `Fetching full history of ${ branch } ...` ) ;
244244
245245 try {
246- await $ `git fetch origin ${ depth ? `--depth=${ depth } ` : "" } ${ branch } ` ;
246+ await $ `git fetch origin ${ depth ? `--depth=${ depth } ` : "" } + ${ branch } :refs/remotes/origin/ ${ branch } ` ;
247247 console . log ( `✓ Successfully fetched ${ branch } history` ) ;
248248 } catch ( error ) {
249249 throw new Error (
You can’t perform that action at this time.
0 commit comments