mirror of
https://github.com/Microsoft/vscode
synced 2024-09-18 01:58:27 +00:00
parent
612b072362
commit
f367d0fe20
|
@ -28,6 +28,10 @@ function main(argv: string[]): void {
|
|||
return fatal('Missing pipe');
|
||||
}
|
||||
|
||||
if (process.env['VSCODE_GIT_COMMAND'] === 'fetch' && !!process.env['VSCODE_GIT_FETCH_SILENT']) {
|
||||
return fatal('Skip silent fetch commands');
|
||||
}
|
||||
|
||||
const output = process.env['VSCODE_GIT_ASKPASS_PIPE'] as string;
|
||||
const socketPath = process.env['VSCODE_GIT_ASKPASS_HANDLE'] as string;
|
||||
const request = argv[2];
|
||||
|
|
|
@ -99,7 +99,7 @@ export class AutoFetcher {
|
|||
}
|
||||
|
||||
try {
|
||||
await this.repository.fetchDefault();
|
||||
await this.repository.fetchDefault({ silent: true });
|
||||
} catch (err) {
|
||||
if (err.gitErrorCode === GitErrorCodes.AuthenticationFailed) {
|
||||
this.disable();
|
||||
|
|
|
@ -1401,8 +1401,9 @@ export class Repository {
|
|||
await this.run(args);
|
||||
}
|
||||
|
||||
async fetch(options: { remote?: string, ref?: string, all?: boolean, prune?: boolean, depth?: number } = {}): Promise<void> {
|
||||
async fetch(options: { remote?: string, ref?: string, all?: boolean, prune?: boolean, depth?: number, silent?: boolean } = {}): Promise<void> {
|
||||
const args = ['fetch'];
|
||||
const spawnOptions: SpawnOptions = {};
|
||||
|
||||
if (options.remote) {
|
||||
args.push(options.remote);
|
||||
|
@ -1422,8 +1423,12 @@ export class Repository {
|
|||
args.push(`--depth=${options.depth}`);
|
||||
}
|
||||
|
||||
if (options.silent) {
|
||||
spawnOptions.env = { 'VSCODE_GIT_FETCH_SILENT': 'true' };
|
||||
}
|
||||
|
||||
try {
|
||||
await this.run(args);
|
||||
await this.run(args, spawnOptions);
|
||||
} catch (err) {
|
||||
if (/No remote repository specified\./.test(err.stderr || '')) {
|
||||
err.gitErrorCode = GitErrorCodes.NoRemoteRepositorySpecified;
|
||||
|
|
|
@ -1054,8 +1054,8 @@ export class Repository implements Disposable {
|
|||
}
|
||||
|
||||
@throttle
|
||||
async fetchDefault(): Promise<void> {
|
||||
await this.run(Operation.Fetch, () => this.repository.fetch());
|
||||
async fetchDefault(options: { silent?: boolean } = {}): Promise<void> {
|
||||
await this.run(Operation.Fetch, () => this.repository.fetch(options));
|
||||
}
|
||||
|
||||
@throttle
|
||||
|
|
Loading…
Reference in a new issue