@@ -10,8 +10,7 @@ import * as path from 'path';
1010import * as os from 'os' ;
1111import * as cp from 'child_process' ;
1212import * as denodeify from 'denodeify' ;
13- import { IDisposable , toDisposable , dispose } from './util' ;
14- import * as _ from 'lodash' ;
13+ import { assign , uniqBy , groupBy , IDisposable , toDisposable , dispose } from './util' ;
1514import { EventEmitter , Event } from 'vscode' ;
1615import * as nls from 'vscode-nls' ;
1716
@@ -292,12 +291,12 @@ export class Git {
292291 }
293292
294293 async exec ( cwd : string , args : string [ ] , options : any = { } ) : Promise < IExecutionResult > {
295- options = _ . assign ( { cwd } , options || { } ) ;
294+ options = assign ( { cwd } , options || { } ) ;
296295 return await this . _exec ( args , options ) ;
297296 }
298297
299298 stream ( cwd : string , args : string [ ] , options : any = { } ) : cp . ChildProcess {
300- options = _ . assign ( { cwd } , options || { } ) ;
299+ options = assign ( { cwd } , options || { } ) ;
301300 return this . spawn ( args , options ) ;
302301 }
303302
@@ -357,7 +356,7 @@ export class Git {
357356 options . stdio = [ 'ignore' , null , null ] ; // Unless provided, ignore stdin and leave default streams for stdout and stderr
358357 }
359358
360- options . env = _ . assign ( { } , process . env , options . env || { } ) ;
359+ options . env = assign ( { } , process . env , options . env || { } ) ;
361360
362361 if ( options . log !== false ) {
363362 this . log ( `git ${ args . join ( ' ' ) } \n` ) ;
@@ -394,22 +393,22 @@ export class Repository {
394393
395394 // TODO@Joao : rename to exec
396395 async run ( args : string [ ] , options : any = { } ) : Promise < IExecutionResult > {
397- options . env = _ . assign ( { } , options . env || { } ) ;
398- options . env = _ . assign ( options . env , this . env ) ;
396+ options . env = assign ( { } , options . env || { } ) ;
397+ options . env = assign ( options . env , this . env ) ;
399398
400399 return await this . git . exec ( this . repository , args , options ) ;
401400 }
402401
403402 stream ( args : string [ ] , options : any = { } ) : cp . ChildProcess {
404- options . env = _ . assign ( { } , options . env || { } ) ;
405- options . env = _ . assign ( options . env , this . env ) ;
403+ options . env = assign ( { } , options . env || { } ) ;
404+ options . env = assign ( options . env , this . env ) ;
406405
407406 return this . git . stream ( this . repository , args , options ) ;
408407 }
409408
410409 spawn ( args : string [ ] , options : any = { } ) : cp . ChildProcess {
411- options . env = _ . assign ( { } , options . env || { } ) ;
412- options . env = _ . assign ( options . env , this . env ) ;
410+ options . env = assign ( { } , options . env || { } ) ;
411+ options . env = assign ( options . env , this . env ) ;
413412
414413 return this . git . spawn ( args , options ) ;
415414 }
@@ -573,11 +572,9 @@ export class Repository {
573572 }
574573
575574 async clean ( paths : string [ ] ) : Promise < void > {
576- const tasks = _ ( paths )
577- . groupBy ( p => path . dirname ( p ) )
578- . values < string [ ] > ( )
579- . map ( paths => ( ) => this . run ( [ 'clean' , '-f' , '-q' , '--' ] . concat ( paths ) ) )
580- . value ( ) ;
575+ const pathsByGroup = groupBy ( paths , p => path . dirname ( p ) ) ;
576+ const groups = Object . keys ( pathsByGroup ) . map ( k => pathsByGroup [ k ] ) ;
577+ const tasks = groups . map ( paths => ( ) => this . run ( [ 'clean' , '-f' , '-q' , '--' ] . concat ( paths ) ) ) ;
581578
582579 for ( let task of tasks ) {
583580 await task ( ) ;
@@ -802,14 +799,13 @@ export class Repository {
802799 async getRemotes ( ) : Promise < IRemote [ ] > {
803800 const result = await this . run ( [ 'remote' , '--verbose' ] ) ;
804801 const regex = / ^ ( [ ^ \s ] + ) \s + ( [ ^ \s ] + ) \s / ;
805-
806- return _ ( result . stdout . trim ( ) . split ( '\n' ) )
802+ const rawRemotes = result . stdout . trim ( ) . split ( '\n' )
807803 . filter ( b => ! ! b )
808804 . map ( line => regex . exec ( line ) )
809805 . filter ( g => ! ! g )
810- . map ( ( groups : RegExpExecArray ) => ( { name : groups [ 1 ] , url : groups [ 2 ] } ) )
811- . uniqBy ( remote => remote . name )
812- . value ( ) ;
806+ . map ( ( groups : RegExpExecArray ) => ( { name : groups [ 1 ] , url : groups [ 2 ] } ) ) ;
807+
808+ return uniqBy ( rawRemotes , remote => remote . name ) ;
813809 }
814810
815811 async getBranch ( name : string ) : Promise < IBranch > {
0 commit comments