File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1226,12 +1226,13 @@ export class Repository {
12261226 args . push ( '--' ) ;
12271227
12281228 if ( paths && paths . length ) {
1229- args . push . apply ( args , paths . map ( sanitizePath ) ) ;
1229+ for ( const chunk of splitInChunks ( paths , MAX_CLI_LENGTH ) ) {
1230+ await this . run ( [ ...args , ...chunk ] ) ;
1231+ }
12301232 } else {
12311233 args . push ( '.' ) ;
1234+ await this . run ( args ) ;
12321235 }
1233-
1234- await this . run ( args ) ;
12351236 }
12361237
12371238 async rm ( paths : string [ ] ) : Promise < void > {
@@ -1480,14 +1481,15 @@ export class Repository {
14801481 args = [ 'reset' , '-q' , treeish , '--' ] ;
14811482 }
14821483
1483- if ( paths && paths . length ) {
1484- args . push . apply ( args , paths . map ( sanitizePath ) ) ;
1485- } else {
1486- args . push ( '.' ) ;
1487- }
1488-
14891484 try {
1490- await this . run ( args ) ;
1485+ if ( paths && paths . length > 0 ) {
1486+ for ( const chunk of splitInChunks ( paths , MAX_CLI_LENGTH ) ) {
1487+ await this . run ( [ ...args , ...chunk ] ) ;
1488+ }
1489+ } else {
1490+ args . push ( '.' ) ;
1491+ await this . run ( args ) ;
1492+ }
14911493 } catch ( err ) {
14921494 // In case there are merge conflicts to be resolved, git reset will output
14931495 // some "needs merge" data. We try to get around that.
You can’t perform that action at this time.
0 commit comments