@@ -15,7 +15,7 @@ import { debug, log, logName } from '../../system/decorators/log';
15
15
import { memoize } from '../../system/decorators/memoize' ;
16
16
import type { Deferrable } from '../../system/function' ;
17
17
import { debounce } from '../../system/function' ;
18
- import { filter , groupByMap , join , map , min , some } from '../../system/iterable' ;
18
+ import { filter , join , map , min , some } from '../../system/iterable' ;
19
19
import { getLoggableName , Logger } from '../../system/logger' ;
20
20
import { getLogScope } from '../../system/logger.scope' ;
21
21
import { updateRecordValue } from '../../system/object' ;
@@ -26,9 +26,8 @@ import { configuration } from '../../system/vscode/configuration';
26
26
import type { GitProviderDescriptor , GitProviderRepository } from '../gitProvider' ;
27
27
import type { GitProviderService } from '../gitProviderService' ;
28
28
import type { GitBranch } from './branch' ;
29
- import { getBranchNameWithoutRemote , getRemoteNameFromBranchName } from './branch' ;
30
29
import type { GitBranchReference , GitReference , GitTagReference } from './reference' ;
31
- import { getNameWithoutRemote , isBranchReference } from './reference' ;
30
+ import { isBranchReference } from './reference' ;
32
31
import type { GitRemote } from './remote' ;
33
32
import type { GitWorktree } from './worktree' ;
34
33
@@ -560,49 +559,6 @@ export class Repository implements Disposable {
560
559
return remote ;
561
560
}
562
561
563
- @log ( )
564
- branchDelete ( branches : GitBranchReference | GitBranchReference [ ] , options ?: { force ?: boolean ; remote ?: boolean } ) {
565
- if ( ! Array . isArray ( branches ) ) {
566
- branches = [ branches ] ;
567
- }
568
-
569
- const localBranches = branches . filter ( b => ! b . remote ) ;
570
- if ( localBranches . length !== 0 ) {
571
- const args = [ '--delete' ] ;
572
- if ( options ?. force ) {
573
- args . push ( '--force' ) ;
574
- }
575
- void this . runTerminalCommand ( 'branch' , ...args , ...branches . map ( b => b . ref ) ) ;
576
-
577
- if ( options ?. remote ) {
578
- const trackingBranches = localBranches . filter ( b => b . upstream != null ) ;
579
- if ( trackingBranches . length !== 0 ) {
580
- const branchesByOrigin = groupByMap ( trackingBranches , b =>
581
- getRemoteNameFromBranchName ( b . upstream ! . name ) ,
582
- ) ;
583
-
584
- for ( const [ remote , branches ] of branchesByOrigin . entries ( ) ) {
585
- void this . runTerminalCommand (
586
- 'push' ,
587
- '-d' ,
588
- remote ,
589
- ...branches . map ( b => getBranchNameWithoutRemote ( b . upstream ! . name ) ) ,
590
- ) ;
591
- }
592
- }
593
- }
594
- }
595
-
596
- const remoteBranches = branches . filter ( b => b . remote ) ;
597
- if ( remoteBranches . length !== 0 ) {
598
- const branchesByOrigin = groupByMap ( remoteBranches , b => getRemoteNameFromBranchName ( b . name ) ) ;
599
-
600
- for ( const [ remote , branches ] of branchesByOrigin . entries ( ) ) {
601
- void this . runTerminalCommand ( 'push' , '-d' , remote , ...branches . map ( b => getNameWithoutRemote ( b ) ) ) ;
602
- }
603
- }
604
- }
605
-
606
562
@log ( )
607
563
cherryPick ( ...args : string [ ] ) {
608
564
void this . runTerminalCommand ( 'cherry-pick' , ...args ) ;
0 commit comments