@@ -924,21 +924,19 @@ export class DeepLinkService implements Disposable {
924
924
925
925
if ( remoteName ) {
926
926
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
+ }
928
935
} catch {
929
936
action = DeepLinkServiceAction . DeepLinkErrored ;
930
937
message = 'Failed to add remote.' ;
931
938
break ;
932
939
}
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
- }
942
940
} else {
943
941
action = DeepLinkServiceAction . DeepLinkCancelled ;
944
942
break ;
@@ -953,23 +951,19 @@ export class DeepLinkService implements Disposable {
953
951
954
952
if ( secondaryRemoteName ) {
955
953
try {
956
- await repo . git
954
+ this . _context . secondaryRemote = await repo . git
957
955
. remotes ( )
958
956
. addRemoteWithResult ?.( secondaryRemoteName , secondaryRemoteUrl , { fetch : true } ) ;
957
+ if ( ! this . _context . secondaryRemote ) {
958
+ action = DeepLinkServiceAction . DeepLinkErrored ;
959
+ message = 'Failed to add remote.' ;
960
+ break ;
961
+ }
959
962
} catch {
960
963
action = DeepLinkServiceAction . DeepLinkErrored ;
961
964
message = 'Failed to add remote.' ;
962
965
break ;
963
966
}
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
- }
973
967
} else {
974
968
action = DeepLinkServiceAction . DeepLinkCancelled ;
975
969
break ;
0 commit comments