mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-24 12:19:20 +00:00
@@ -28,6 +28,10 @@ function main(argv: string[]): void {
|
|||||||
return fatal('Missing pipe');
|
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 output = process.env['VSCODE_GIT_ASKPASS_PIPE'] as string;
|
||||||
const socketPath = process.env['VSCODE_GIT_ASKPASS_HANDLE'] as string;
|
const socketPath = process.env['VSCODE_GIT_ASKPASS_HANDLE'] as string;
|
||||||
const request = argv[2];
|
const request = argv[2];
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ export class AutoFetcher {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await this.repository.fetchDefault();
|
await this.repository.fetchDefault({ silent: true });
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
if (err.gitErrorCode === GitErrorCodes.AuthenticationFailed) {
|
if (err.gitErrorCode === GitErrorCodes.AuthenticationFailed) {
|
||||||
this.disable();
|
this.disable();
|
||||||
|
|||||||
@@ -1401,8 +1401,9 @@ export class Repository {
|
|||||||
await this.run(args);
|
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 args = ['fetch'];
|
||||||
|
const spawnOptions: SpawnOptions = {};
|
||||||
|
|
||||||
if (options.remote) {
|
if (options.remote) {
|
||||||
args.push(options.remote);
|
args.push(options.remote);
|
||||||
@@ -1422,8 +1423,12 @@ export class Repository {
|
|||||||
args.push(`--depth=${options.depth}`);
|
args.push(`--depth=${options.depth}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (options.silent) {
|
||||||
|
spawnOptions.env = { 'VSCODE_GIT_FETCH_SILENT': 'true' };
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await this.run(args);
|
await this.run(args, spawnOptions);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
if (/No remote repository specified\./.test(err.stderr || '')) {
|
if (/No remote repository specified\./.test(err.stderr || '')) {
|
||||||
err.gitErrorCode = GitErrorCodes.NoRemoteRepositorySpecified;
|
err.gitErrorCode = GitErrorCodes.NoRemoteRepositorySpecified;
|
||||||
|
|||||||
@@ -1054,8 +1054,8 @@ export class Repository implements Disposable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@throttle
|
@throttle
|
||||||
async fetchDefault(): Promise<void> {
|
async fetchDefault(options: { silent?: boolean } = {}): Promise<void> {
|
||||||
await this.run(Operation.Fetch, () => this.repository.fetch());
|
await this.run(Operation.Fetch, () => this.repository.fetch(options));
|
||||||
}
|
}
|
||||||
|
|
||||||
@throttle
|
@throttle
|
||||||
|
|||||||
Reference in New Issue
Block a user