Skip to content

Commit 8cce062

Browse files
committed
💄
1 parent 9fcc5e8 commit 8cce062

1 file changed

Lines changed: 10 additions & 13 deletions

File tree

extensions/git/src/git.ts

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1223,15 +1223,12 @@ export class Repository {
12231223
args.push('-A');
12241224
}
12251225

1226-
args.push('--');
1227-
12281226
if (paths && paths.length) {
12291227
for (const chunk of splitInChunks(paths, MAX_CLI_LENGTH)) {
1230-
await this.run([...args, ...chunk]);
1228+
await this.run([...args, '--', ...chunk]);
12311229
}
12321230
} else {
1233-
args.push('.');
1234-
await this.run(args);
1231+
await this.run([...args, '--', '.']);
12351232
}
12361233
}
12371234

@@ -1441,10 +1438,11 @@ export class Repository {
14411438

14421439
const limiter = new Limiter(5);
14431440
const promises: Promise<any>[] = [];
1441+
const args = ['clean', '-f', '-q'];
14441442

14451443
for (const paths of groups) {
14461444
for (const chunk of splitInChunks(paths, MAX_CLI_LENGTH)) {
1447-
promises.push(limiter.queue(() => this.run(['clean', '-f', '-q', '--', ...chunk])));
1445+
promises.push(limiter.queue(() => this.run([...args, '--', ...chunk])));
14481446
}
14491447
}
14501448

@@ -1476,19 +1474,18 @@ export class Repository {
14761474

14771475
// In case there are no branches, we must use rm --cached
14781476
if (!result.stdout) {
1479-
args = ['rm', '--cached', '-r', '--'];
1477+
args = ['rm', '--cached', '-r'];
14801478
} else {
1481-
args = ['reset', '-q', treeish, '--'];
1479+
args = ['reset', '-q', treeish];
14821480
}
14831481

14841482
try {
14851483
if (paths && paths.length > 0) {
14861484
for (const chunk of splitInChunks(paths, MAX_CLI_LENGTH)) {
1487-
await this.run([...args, ...chunk]);
1485+
await this.run([...args, '--', ...chunk]);
14881486
}
14891487
} else {
1490-
args.push('.');
1491-
await this.run(args);
1488+
await this.run([...args, '--', '.']);
14921489
}
14931490
} catch (err) {
14941491
// In case there are merge conflicts to be resolved, git reset will output
@@ -1977,10 +1974,10 @@ export class Repository {
19771974
}
19781975

19791976
async updateSubmodules(paths: string[]): Promise<void> {
1980-
const args = ['submodule', 'update', '--'];
1977+
const args = ['submodule', 'update'];
19811978

19821979
for (const chunk of splitInChunks(paths.map(sanitizePath), MAX_CLI_LENGTH)) {
1983-
await this.run([...args, ...chunk]);
1980+
await this.run([...args, '--', ...chunk]);
19841981
}
19851982
}
19861983

0 commit comments

Comments
 (0)