@@ -182,6 +182,7 @@ export class Resource implements SourceControlResourceState {
182
182
get type ( ) : Status { return this . _type ; }
183
183
get original ( ) : Uri { return this . _resourceUri ; }
184
184
get renameResourceUri ( ) : Uri | undefined { return this . _renameResourceUri ; }
185
+ get contextValue ( ) : string | undefined { return this . _repositoryKind ; }
185
186
186
187
private static Icons : any = {
187
188
light : {
@@ -310,6 +311,7 @@ export class Resource implements SourceControlResourceState {
310
311
private _type : Status ,
311
312
private _useIcons : boolean ,
312
313
private _renameResourceUri ?: Uri ,
314
+ private _repositoryKind ?: 'repository' | 'submodule' | 'worktree' ,
313
315
) { }
314
316
315
317
async open ( ) : Promise < void > {
@@ -328,7 +330,7 @@ export class Resource implements SourceControlResourceState {
328
330
}
329
331
330
332
clone ( resourceGroupType ?: ResourceGroupType ) {
331
- return new Resource ( this . _commandResolver , resourceGroupType ?? this . _resourceGroupType , this . _resourceUri , this . _type , this . _useIcons , this . _renameResourceUri ) ;
333
+ return new Resource ( this . _commandResolver , resourceGroupType ?? this . _resourceGroupType , this . _resourceUri , this . _type , this . _useIcons , this . _renameResourceUri , this . _repositoryKind ) ;
332
334
}
333
335
}
334
336
@@ -2511,12 +2513,12 @@ export class Repository implements Disposable {
2511
2513
2512
2514
switch ( raw . x + raw . y ) {
2513
2515
case '??' : switch ( untrackedChanges ) {
2514
- case 'mixed' : return workingTreeGroup . push ( new Resource ( this . resourceCommandResolver , ResourceGroupType . WorkingTree , uri , Status . UNTRACKED , useIcons ) ) ;
2516
+ case 'mixed' : return workingTreeGroup . push ( new Resource ( this . resourceCommandResolver , ResourceGroupType . WorkingTree , uri , Status . UNTRACKED , useIcons , undefined , this . kind ) ) ;
2515
2517
case 'separate' : return untrackedGroup . push ( new Resource ( this . resourceCommandResolver , ResourceGroupType . Untracked , uri , Status . UNTRACKED , useIcons ) ) ;
2516
2518
default : return undefined ;
2517
2519
}
2518
2520
case '!!' : switch ( untrackedChanges ) {
2519
- case 'mixed' : return workingTreeGroup . push ( new Resource ( this . resourceCommandResolver , ResourceGroupType . WorkingTree , uri , Status . IGNORED , useIcons ) ) ;
2521
+ case 'mixed' : return workingTreeGroup . push ( new Resource ( this . resourceCommandResolver , ResourceGroupType . WorkingTree , uri , Status . IGNORED , useIcons , undefined , this . kind ) ) ;
2520
2522
case 'separate' : return untrackedGroup . push ( new Resource ( this . resourceCommandResolver , ResourceGroupType . Untracked , uri , Status . IGNORED , useIcons ) ) ;
2521
2523
default : return undefined ;
2522
2524
}
@@ -2530,19 +2532,19 @@ export class Repository implements Disposable {
2530
2532
}
2531
2533
2532
2534
switch ( raw . x ) {
2533
- case 'M' : indexGroup . push ( new Resource ( this . resourceCommandResolver , ResourceGroupType . Index , uri , Status . INDEX_MODIFIED , useIcons ) ) ; break ;
2534
- case 'A' : indexGroup . push ( new Resource ( this . resourceCommandResolver , ResourceGroupType . Index , uri , Status . INDEX_ADDED , useIcons ) ) ; break ;
2535
- case 'D' : indexGroup . push ( new Resource ( this . resourceCommandResolver , ResourceGroupType . Index , uri , Status . INDEX_DELETED , useIcons ) ) ; break ;
2536
- case 'R' : indexGroup . push ( new Resource ( this . resourceCommandResolver , ResourceGroupType . Index , uri , Status . INDEX_RENAMED , useIcons , renameUri ) ) ; break ;
2537
- case 'C' : indexGroup . push ( new Resource ( this . resourceCommandResolver , ResourceGroupType . Index , uri , Status . INDEX_COPIED , useIcons , renameUri ) ) ; break ;
2535
+ case 'M' : indexGroup . push ( new Resource ( this . resourceCommandResolver , ResourceGroupType . Index , uri , Status . INDEX_MODIFIED , useIcons , undefined , this . kind ) ) ; break ;
2536
+ case 'A' : indexGroup . push ( new Resource ( this . resourceCommandResolver , ResourceGroupType . Index , uri , Status . INDEX_ADDED , useIcons , undefined , this . kind ) ) ; break ;
2537
+ case 'D' : indexGroup . push ( new Resource ( this . resourceCommandResolver , ResourceGroupType . Index , uri , Status . INDEX_DELETED , useIcons , undefined , this . kind ) ) ; break ;
2538
+ case 'R' : indexGroup . push ( new Resource ( this . resourceCommandResolver , ResourceGroupType . Index , uri , Status . INDEX_RENAMED , useIcons , renameUri , this . kind ) ) ; break ;
2539
+ case 'C' : indexGroup . push ( new Resource ( this . resourceCommandResolver , ResourceGroupType . Index , uri , Status . INDEX_COPIED , useIcons , renameUri , this . kind ) ) ; break ;
2538
2540
}
2539
2541
2540
2542
switch ( raw . y ) {
2541
- case 'M' : workingTreeGroup . push ( new Resource ( this . resourceCommandResolver , ResourceGroupType . WorkingTree , uri , Status . MODIFIED , useIcons , renameUri ) ) ; break ;
2542
- case 'D' : workingTreeGroup . push ( new Resource ( this . resourceCommandResolver , ResourceGroupType . WorkingTree , uri , Status . DELETED , useIcons , renameUri ) ) ; break ;
2543
- case 'A' : workingTreeGroup . push ( new Resource ( this . resourceCommandResolver , ResourceGroupType . WorkingTree , uri , Status . INTENT_TO_ADD , useIcons , renameUri ) ) ; break ;
2544
- case 'R' : workingTreeGroup . push ( new Resource ( this . resourceCommandResolver , ResourceGroupType . WorkingTree , uri , Status . INTENT_TO_RENAME , useIcons , renameUri ) ) ; break ;
2545
- case 'T' : workingTreeGroup . push ( new Resource ( this . resourceCommandResolver , ResourceGroupType . WorkingTree , uri , Status . TYPE_CHANGED , useIcons , renameUri ) ) ; break ;
2543
+ case 'M' : workingTreeGroup . push ( new Resource ( this . resourceCommandResolver , ResourceGroupType . WorkingTree , uri , Status . MODIFIED , useIcons , renameUri , this . kind ) ) ; break ;
2544
+ case 'D' : workingTreeGroup . push ( new Resource ( this . resourceCommandResolver , ResourceGroupType . WorkingTree , uri , Status . DELETED , useIcons , renameUri , this . kind ) ) ; break ;
2545
+ case 'A' : workingTreeGroup . push ( new Resource ( this . resourceCommandResolver , ResourceGroupType . WorkingTree , uri , Status . INTENT_TO_ADD , useIcons , renameUri , this . kind ) ) ; break ;
2546
+ case 'R' : workingTreeGroup . push ( new Resource ( this . resourceCommandResolver , ResourceGroupType . WorkingTree , uri , Status . INTENT_TO_RENAME , useIcons , renameUri , this . kind ) ) ; break ;
2547
+ case 'T' : workingTreeGroup . push ( new Resource ( this . resourceCommandResolver , ResourceGroupType . WorkingTree , uri , Status . TYPE_CHANGED , useIcons , renameUri , this . kind ) ) ; break ;
2546
2548
}
2547
2549
2548
2550
return undefined ;
0 commit comments