Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/src/vs/workbench/contrib/chat/browser/pluginGitCommandService.ts
13401 views
1
/*---------------------------------------------------------------------------------------------
2
* Copyright (c) Microsoft Corporation. All rights reserved.
3
* Licensed under the MIT License. See License.txt in the project root for license information.
4
*--------------------------------------------------------------------------------------------*/
5
6
import { CancellationToken } from '../../../../base/common/cancellation.js';
7
import { URI } from '../../../../base/common/uri.js';
8
import { localize } from '../../../../nls.js';
9
import { IPluginGitService } from '../common/plugins/pluginGitService.js';
10
11
function notSupported(): never {
12
throw new Error(localize('pluginsNotSupported', 'Agent plugins are not available in this environment'));
13
}
14
15
/**
16
* Stub implementation of {@link IPluginGitService} that throws on
17
* every call. On desktop the native implementation is registered instead;
18
* this exists only so the browser layer has a default registration.
19
*/
20
export class BrowserPluginGitCommandService implements IPluginGitService {
21
declare readonly _serviceBrand: undefined;
22
23
async cloneRepository(_cloneUrl: string, _targetDir: URI, _ref?: string, _token?: CancellationToken): Promise<void> { notSupported(); }
24
async pull(_repoDir: URI, _token?: CancellationToken): Promise<boolean> { notSupported(); }
25
async checkout(_repoDir: URI, _treeish: string, _detached?: boolean, _token?: CancellationToken): Promise<void> { notSupported(); }
26
async revParse(_repoDir: URI, _ref: string): Promise<string> { notSupported(); }
27
async fetch(_repoDir: URI, _token?: CancellationToken): Promise<void> { notSupported(); }
28
async fetchRepository(_repoDir: URI, _token?: CancellationToken): Promise<void> { notSupported(); }
29
async revListCount(_repoDir: URI, _fromRef: string, _toRef: string): Promise<number> { notSupported(); }
30
}
31
32