@@ -5725,7 +5725,7 @@ export class AppStore extends TypedBaseStore<IAppState> {
57255725 public async _updateRepositoryAccount (
57265726 repository : Repository ,
57275727 account : Account | null
5728- ) : Promise < void > {
5728+ ) : Promise < Repository > {
57295729 if ( repository . gitHubRepository && account === null ) {
57305730 await this . repositoriesStore . clearGitHubRepositoryLogin (
57315731 repository . gitHubRepository
@@ -5739,6 +5739,7 @@ export class AppStore extends TypedBaseStore<IAppState> {
57395739 repo
57405740 )
57415741 await this . _refreshRepository ( refreshedRepo )
5742+ return refreshedRepo
57425743 }
57435744
57445745 public async _updateRepositoryEditorOverride (
@@ -6287,7 +6288,7 @@ export class AppStore extends TypedBaseStore<IAppState> {
62876288
62886289 /** This shouldn't be called directly. See `Dispatcher`. */
62896290 public async _publishRepository (
6290- repository : Repository ,
6291+ oldRepo : Repository ,
62916292 name : string ,
62926293 description : string ,
62936294 private_ : boolean ,
@@ -6302,8 +6303,11 @@ export class AppStore extends TypedBaseStore<IAppState> {
63026303 private_
63036304 )
63046305
6305- const gitStore = this . gitStoreCache . get ( repository )
6306+ const gitStore = this . gitStoreCache . get ( oldRepo )
63066307 await gitStore . addRemote ( 'origin' , apiRepository . clone_url )
6308+ await gitStore . refreshDefaultBranch ( )
6309+
6310+ const repository = await this . _updateRepositoryAccount ( oldRepo , account )
63076311
63086312 // skip pushing if the current branch is a detached HEAD or the repository
63096313 // is unborn
@@ -6320,9 +6324,7 @@ export class AppStore extends TypedBaseStore<IAppState> {
63206324 await this . performPush ( repository )
63216325 }
63226326
6323- await gitStore . refreshDefaultBranch ( )
6324-
6325- return this . repositoryWithRefreshedGitHubRepository ( repository )
6327+ return repository
63266328 }
63276329
63286330 /** This shouldn't be called directly. See `Dispatcher`. */
0 commit comments