@@ -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
@@ -591,49 +591,6 @@ export class Repository implements Disposable {
591591 return remote ;
592592 }
593593
594- @log ( )
595- branchDelete ( branches : GitBranchReference | GitBranchReference [ ] , options ?: { force ?: boolean ; remote ?: boolean } ) {
596- if ( ! Array . isArray ( branches ) ) {
597- branches = [ branches ] ;
598- }
599-
600- const localBranches = branches . filter ( b => ! b . remote ) ;
601- if ( localBranches . length !== 0 ) {
602- const args = [ '--delete' ] ;
603- if ( options ?. force ) {
604- args . push ( '--force' ) ;
605- }
606- void this . runTerminalCommand ( 'branch' , ...args , ...branches . map ( b => b . ref ) ) ;
607-
608- if ( options ?. remote ) {
609- const trackingBranches = localBranches . filter ( b => b . upstream != null ) ;
610- if ( trackingBranches . length !== 0 ) {
611- const branchesByOrigin = groupByMap ( trackingBranches , b =>
612- getRemoteNameFromBranchName ( b . upstream ! . name ) ,
613- ) ;
614-
615- for ( const [ remote , branches ] of branchesByOrigin . entries ( ) ) {
616- void this . runTerminalCommand (
617- 'push' ,
618- '-d' ,
619- remote ,
620- ...branches . map ( b => getBranchNameWithoutRemote ( b . upstream ! . name ) ) ,
621- ) ;
622- }
623- }
624- }
625- }
626-
627- const remoteBranches = branches . filter ( b => b . remote ) ;
628- if ( remoteBranches . length !== 0 ) {
629- const branchesByOrigin = groupByMap ( remoteBranches , b => getRemoteNameFromBranchName ( b . name ) ) ;
630-
631- for ( const [ remote , branches ] of branchesByOrigin . entries ( ) ) {
632- void this . runTerminalCommand ( 'push' , '-d' , remote , ...branches . map ( b => getNameWithoutRemote ( b ) ) ) ;
633- }
634- }
635- }
636-
637594 @log ( )
638595 cherryPick ( ...args : string [ ] ) {
639596 void this . runTerminalCommand ( 'cherry-pick' , ...args ) ;
0 commit comments