@@ -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,9 @@ 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' ;
30- import type { GitBranchReference , GitReference } from './reference' ;
29+ import type { GitBranchReference , GitReference , GitTagReference } from './reference' ;
3130import { getNameWithoutRemote , isBranchReference } from './reference' ;
31+ import { getBranchNameWithoutRemote , getRemoteNameFromBranchName } from './branch' ;
3232import type { GitRemote } from './remote' ;
3333import type { GitWorktree } from './worktree' ;
3434
@@ -584,49 +584,6 @@ export class Repository implements Disposable {
584584 return remote ;
585585 }
586586
587- @log ( )
588- branchDelete ( branches : GitBranchReference | GitBranchReference [ ] , options ?: { force ?: boolean ; remote ?: boolean } ) {
589- if ( ! Array . isArray ( branches ) ) {
590- branches = [ branches ] ;
591- }
592-
593- const localBranches = branches . filter ( b => ! b . remote ) ;
594- if ( localBranches . length !== 0 ) {
595- const args = [ '--delete' ] ;
596- if ( options ?. force ) {
597- args . push ( '--force' ) ;
598- }
599- void this . runTerminalCommand ( 'branch' , ...args , ...branches . map ( b => b . ref ) ) ;
600-
601- if ( options ?. remote ) {
602- const trackingBranches = localBranches . filter ( b => b . upstream != null ) ;
603- if ( trackingBranches . length !== 0 ) {
604- const branchesByOrigin = groupByMap ( trackingBranches , b =>
605- getRemoteNameFromBranchName ( b . upstream ! . name ) ,
606- ) ;
607-
608- for ( const [ remote , branches ] of branchesByOrigin . entries ( ) ) {
609- void this . runTerminalCommand (
610- 'push' ,
611- '-d' ,
612- remote ,
613- ...branches . map ( b => getBranchNameWithoutRemote ( b . upstream ! . name ) ) ,
614- ) ;
615- }
616- }
617- }
618- }
619-
620- const remoteBranches = branches . filter ( b => b . remote ) ;
621- if ( remoteBranches . length !== 0 ) {
622- const branchesByOrigin = groupByMap ( remoteBranches , b => getRemoteNameFromBranchName ( b . name ) ) ;
623-
624- for ( const [ remote , branches ] of branchesByOrigin . entries ( ) ) {
625- void this . runTerminalCommand ( 'push' , '-d' , remote , ...branches . map ( b => getNameWithoutRemote ( b ) ) ) ;
626- }
627- }
628- }
629-
630587 @log ( )
631588 cherryPick ( ...args : string [ ] ) {
632589 void this . runTerminalCommand ( 'cherry-pick' , ...args ) ;
0 commit comments