@@ -10,7 +10,7 @@ import { getBranchNameWithoutRemote } from '../../git/models/branch';
10
10
import type { GitCommit } from '../../git/models/commit' ;
11
11
import type { GitReference } from '../../git/models/reference' ;
12
12
import { createReference , isSha } from '../../git/models/reference' ;
13
- import type { RepositoryChangeEvent } from '../../git/models/repository' ;
13
+ import type { Repository , RepositoryChangeEvent } from '../../git/models/repository' ;
14
14
import { RepositoryChange , RepositoryChangeComparisonMode } from '../../git/models/repository' ;
15
15
import type { GitTag } from '../../git/models/tag' ;
16
16
import { parseGitRemoteUrl } from '../../git/parsers/remoteParser' ;
@@ -100,7 +100,7 @@ export class DeepLinkService implements Disposable {
100
100
} ;
101
101
}
102
102
103
- private setContextFromDeepLink ( link : DeepLink , url : string ) {
103
+ private setContextFromDeepLink ( link : DeepLink , url : string , repo ?: Repository ) {
104
104
this . _context = {
105
105
...this . _context ,
106
106
mainId : link . mainId ,
@@ -115,9 +115,14 @@ export class DeepLinkService implements Disposable {
115
115
action : link . action ,
116
116
params : link . params ,
117
117
} ;
118
+
119
+ if ( repo != null ) {
120
+ this . _context . repo = repo ;
121
+ this . _context . repoPath = repo . path ;
122
+ }
118
123
}
119
124
120
- async processDeepLinkUri ( uri : Uri , useProgress : boolean = true ) {
125
+ async processDeepLinkUri ( uri : Uri , useProgress : boolean = true , repo ?: Repository ) {
121
126
const link = parseDeepLinkUri ( uri ) ;
122
127
if ( link == null ) return ;
123
128
@@ -150,7 +155,7 @@ export class DeepLinkService implements Disposable {
150
155
return ;
151
156
}
152
157
153
- this . setContextFromDeepLink ( link , uri . toString ( ) ) ;
158
+ this . setContextFromDeepLink ( link , uri . toString ( ) , repo ) ;
154
159
155
160
await this . processDeepLink ( undefined , useProgress ) ;
156
161
}
@@ -499,6 +504,9 @@ export class DeepLinkService implements Disposable {
499
504
return remoteName ;
500
505
}
501
506
507
+ // TODO @axosoft -ramint: Move all the logic for matching a repo, prompting to add repo, matching remote, etc. for a target (branch, PR, etc.)
508
+ // to a separate service where it can be used outside of the context of deep linking. Then the deep link service should leverage it,
509
+ // and we should stop using deep links to process things like Launchpad switch actions, Open in Worktree command, etc.
502
510
private async processDeepLink (
503
511
initialAction : DeepLinkServiceAction = DeepLinkServiceAction . DeepLinkEventFired ,
504
512
useProgress : boolean = true ,
@@ -660,7 +668,7 @@ export class DeepLinkService implements Disposable {
660
668
}
661
669
case DeepLinkServiceState . RepoMatch :
662
670
case DeepLinkServiceState . AddedRepoMatch : {
663
- if ( repo != null && repoOpenUri != null && repoOpenLocation != null ) {
671
+ if ( repo != null ) {
664
672
action = DeepLinkServiceAction . RepoMatched ;
665
673
break ;
666
674
}
0 commit comments