@@ -15,7 +15,7 @@ import { debug, log, logName } from '../../system/decorators/log';
1515import { memoize } from '../../system/decorators/memoize' ;
1616import type { Deferrable } from '../../system/function' ;
1717import { 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' ;
1919import { getLoggableName , Logger } from '../../system/logger' ;
2020import { getLogScope } from '../../system/logger.scope' ;
2121import { updateRecordValue } from '../../system/object' ;
@@ -26,9 +26,8 @@ import { configuration } from '../../system/vscode/configuration';
2626import type { GitProviderDescriptor , GitProviderRepository } from '../gitProvider' ;
2727import type { GitProviderService } from '../gitProviderService' ;
2828import type { GitBranch } from './branch' ;
29- import { getBranchNameWithoutRemote , getRemoteNameFromBranchName } from './branch' ;
3029import type { GitBranchReference , GitReference , GitTagReference } from './reference' ;
31- import { getNameWithoutRemote , isBranchReference } from './reference' ;
30+ import { isBranchReference } from './reference' ;
3231import type { GitRemote } from './remote' ;
3332import type { GitWorktree } from './worktree' ;
3433
@@ -560,49 +559,6 @@ export class Repository implements Disposable {
560559 return remote ;
561560 }
562561
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-
606562 @log ( )
607563 cherryPick ( ...args : string [ ] ) {
608564 void this . runTerminalCommand ( 'cherry-pick' , ...args ) ;
0 commit comments