git: implement API

This commit is contained in:
Joao Moreno
2018-08-24 12:04:29 +02:00
parent 28d2b5d2d6
commit 103715c3cc
5 changed files with 238 additions and 17 deletions

View File

@@ -74,21 +74,15 @@ export interface RepositoryState {
readonly onDidChange: Event<void>;
}
export const enum ConfigScope {
System,
Global,
Local
}
export interface Repository {
readonly rootUri: Uri;
readonly inputBox: InputBox;
readonly state: RepositoryState;
getConfigs(scope: ConfigScope): Promise<{ key: string; value: string; }[]>;
getConfig(scope: ConfigScope, key: string): Promise<string>;
setConfig(scope: ConfigScope, key: string, value: string): Promise<string>;
getConfigs(): Promise<{ key: string; value: string; }[]>;
getConfig(key: string): Promise<string>;
setConfig(key: string, value: string): Promise<string>;
show(ref: string, path: string): Promise<string>;
getCommit(ref: string): Promise<Commit>;