@@ -715,32 +715,56 @@ export class ViewCommands implements Disposable {
715715 }
716716
717717 @log ( )
718- private abortPausedOperation ( node : PausedOperationStatusNode ) {
719- if ( ! node . is ( 'paused-operation-status' ) ) return Promise . resolve ( ) ;
718+ private async abortPausedOperation ( node : PausedOperationStatusNode ) {
719+ if ( ! node . is ( 'paused-operation-status' ) ) return ;
720720
721- return this . container . git . status ( node . pausedOpStatus . repoPath ) . abortPausedOperation ?.( ) ;
721+ const abortPausedOperation = this . container . git . status ( node . pausedOpStatus . repoPath ) . abortPausedOperation ;
722+ if ( abortPausedOperation == null ) return ;
723+
724+ try {
725+ await abortPausedOperation ( ) ;
726+ } catch ( ex ) {
727+ void window . showErrorMessage ( ex . message ) ;
728+ }
722729 }
723730
724731 @log ( )
725- private continuePausedOperation ( node : PausedOperationStatusNode ) {
726- if ( ! node . is ( 'paused-operation-status' ) ) return Promise . resolve ( ) ;
732+ private async continuePausedOperation ( node : PausedOperationStatusNode ) {
733+ if ( ! node . is ( 'paused-operation-status' ) ) return ;
727734
728- return this . container . git . status ( node . pausedOpStatus . repoPath ) . continuePausedOperation ?.( ) ;
735+ const continuePausedOperation = this . container . git . status ( node . pausedOpStatus . repoPath ) . continuePausedOperation ;
736+ if ( continuePausedOperation == null ) return ;
737+
738+ try {
739+ await continuePausedOperation ( ) ;
740+ } catch ( ex ) {
741+ void window . showErrorMessage ( ex . message ) ;
742+ }
729743 }
730744
731745 @log ( )
732- private skipPausedOperation ( node : PausedOperationStatusNode ) {
733- if ( ! node . is ( 'paused-operation-status' ) ) return Promise . resolve ( ) ;
746+ private async skipPausedOperation ( node : PausedOperationStatusNode ) {
747+ if ( ! node . is ( 'paused-operation-status' ) ) return ;
734748
735- return this . container . git . status ( node . pausedOpStatus . repoPath ) . continuePausedOperation ?.( { skip : true } ) ;
749+ const continuePausedOperation = this . container . git . status ( node . pausedOpStatus . repoPath ) . continuePausedOperation ;
750+ if ( continuePausedOperation == null ) return ;
751+
752+ try {
753+ await continuePausedOperation ( { skip : true } ) ;
754+ } catch ( ex ) {
755+ void window . showErrorMessage ( ex . message ) ;
756+ }
736757 }
737758
738759 @log ( )
739- private openPausedOperationInRebaseEditor ( node : PausedOperationStatusNode ) {
740- if ( ! node . is ( 'paused-operation-status' ) || node . pausedOpStatus . type !== 'rebase' ) return Promise . resolve ( ) ;
760+ private async openPausedOperationInRebaseEditor ( node : PausedOperationStatusNode ) {
761+ if ( ! node . is ( 'paused-operation-status' ) || node . pausedOpStatus . type !== 'rebase' ) return ;
762+
763+ const gitDir = await this . container . git . getGitDir ( node . repoPath ) ;
764+ if ( gitDir == null ) return ;
741765
742- const rebaseTodoUri = Uri . joinPath ( node . uri , '.git' , 'rebase-merge' , 'git-rebase-todo' ) ;
743- return executeCoreCommand ( 'vscode.openWith' , rebaseTodoUri , 'gitlens.rebase' , {
766+ const rebaseTodoUri = Uri . joinPath ( gitDir . uri , 'rebase-merge' , 'git-rebase-todo' ) ;
767+ void executeCoreCommand ( 'vscode.openWith' , rebaseTodoUri , 'gitlens.rebase' , {
744768 preview : false ,
745769 } ) ;
746770 }
0 commit comments