@@ -37,6 +37,11 @@ const BASIC_FILE_CHANGES = {
3737 ] ,
3838} ;
3939
40+ // Match branch name as in core.ts
41+ function getInternalTempBranch ( name : string ) {
42+ return `changesets-ghcommit-test/${ name } ` ;
43+ }
44+
4045describe ( "commitFilesFromBase64" , ( ) => {
4146 let repositoryId : string ;
4247 let testTargetCommit : string ;
@@ -247,7 +252,9 @@ describe("commitFilesFromBase64", () => {
247252 describe ( "existing branches" , ( ) => {
248253 it ( "can commit to existing branch when force is true" , async ( ) => {
249254 const branch = getTempBranch ( "existing-branch-force" ) ;
255+ const internalTempBranch = getInternalTempBranch ( branch ) ;
250256 onTestFinished ( ( ) => deleteBranch ( branch ) ) ;
257+ onTestFinished ( ( ) => deleteBranch ( internalTempBranch , true ) ) ;
251258
252259 // Create an exiting branch
253260 await createRefMutation ( octokit , {
@@ -273,13 +280,14 @@ describe("commitFilesFromBase64", () => {
273280 } ) ;
274281
275282 await expectParentHasOid ( { branch, oid : testTargetCommit } ) ;
283+ await expectBranchDoesNotExist ( internalTempBranch ) ;
276284 } ) ;
277285
278286 it ( "cleans up a pre-existing temporary branch when force is true" , async ( ) => {
279287 const branch = getTempBranch ( "existing-branch-force-existing-temp" ) ;
280- const tempBranch = getTempBranch ( `temp- ${ branch } ` ) ;
288+ const internalTempBranch = getInternalTempBranch ( branch ) ;
281289 onTestFinished ( ( ) => deleteBranch ( branch ) ) ;
282- onTestFinished ( ( ) => deleteBranch ( tempBranch ) ) ;
290+ onTestFinished ( ( ) => deleteBranch ( internalTempBranch , true ) ) ;
283291
284292 await createRefMutation ( octokit , {
285293 input : {
@@ -292,7 +300,7 @@ describe("commitFilesFromBase64", () => {
292300 await createRefMutation ( octokit , {
293301 input : {
294302 repositoryId,
295- name : `refs/heads/${ tempBranch } ` ,
303+ name : `refs/heads/${ internalTempBranch } ` ,
296304 oid : testTargetCommit2 ,
297305 } ,
298306 } ) ;
@@ -312,7 +320,7 @@ describe("commitFilesFromBase64", () => {
312320 } ) ;
313321
314322 await expectParentHasOid ( { branch, oid : testTargetCommit } ) ;
315- await expectBranchDoesNotExist ( tempBranch ) ;
323+ await expectBranchDoesNotExist ( internalTempBranch ) ;
316324 } ) ;
317325
318326 it ( "cannot commit to existing branch when force is false" , async ( ) => {
0 commit comments