@@ -924,21 +924,19 @@ export class DeepLinkService implements Disposable {
924924
925925 if ( remoteName ) {
926926 try {
927- await repo . git . remotes ( ) . addRemoteWithResult ?.( remoteName , remoteUrl , { fetch : true } ) ;
927+ this . _context . remote = await repo . git
928+ . remotes ( )
929+ . addRemoteWithResult ?.( remoteName , remoteUrl , { fetch : true } ) ;
930+ if ( ! this . _context . remote ) {
931+ action = DeepLinkServiceAction . DeepLinkErrored ;
932+ message = 'Failed to add remote.' ;
933+ break ;
934+ }
928935 } catch {
929936 action = DeepLinkServiceAction . DeepLinkErrored ;
930937 message = 'Failed to add remote.' ;
931938 break ;
932939 }
933-
934- [ this . _context . remote ] = await repo . git
935- . remotes ( )
936- . getRemotes ( { filter : r => r . url === remoteUrl } ) ;
937- if ( ! this . _context . remote ) {
938- action = DeepLinkServiceAction . DeepLinkErrored ;
939- message = 'Failed to add remote.' ;
940- break ;
941- }
942940 } else {
943941 action = DeepLinkServiceAction . DeepLinkCancelled ;
944942 break ;
@@ -953,23 +951,19 @@ export class DeepLinkService implements Disposable {
953951
954952 if ( secondaryRemoteName ) {
955953 try {
956- await repo . git
954+ this . _context . secondaryRemote = await repo . git
957955 . remotes ( )
958956 . addRemoteWithResult ?.( secondaryRemoteName , secondaryRemoteUrl , { fetch : true } ) ;
957+ if ( ! this . _context . secondaryRemote ) {
958+ action = DeepLinkServiceAction . DeepLinkErrored ;
959+ message = 'Failed to add remote.' ;
960+ break ;
961+ }
959962 } catch {
960963 action = DeepLinkServiceAction . DeepLinkErrored ;
961964 message = 'Failed to add remote.' ;
962965 break ;
963966 }
964-
965- [ this . _context . secondaryRemote ] = await repo . git . remotes ( ) . getRemotes ( {
966- filter : r => r . url === secondaryRemoteUrl ,
967- } ) ;
968- if ( ! this . _context . secondaryRemote ) {
969- action = DeepLinkServiceAction . DeepLinkErrored ;
970- message = 'Failed to add remote.' ;
971- break ;
972- }
973967 } else {
974968 action = DeepLinkServiceAction . DeepLinkCancelled ;
975969 break ;
0 commit comments