MCPcopy
hub / github.com/microsoft/vscode / ApiRepository

Class ApiRepository

extensions/git/src/api/api1.ts:75–372  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

73}
74
75export class ApiRepository implements Repository {
76 #repository: BaseRepository;
77
78 readonly rootUri: Uri;
79 readonly inputBox: InputBox;
80 readonly kind: RepositoryKind;
81 readonly state: RepositoryState;
82 readonly ui: RepositoryUIState;
83 readonly isUsingVirtualFileSystem: boolean;
84
85 readonly onDidCommit: Event<void>;
86 readonly onDidCheckout: Event<void>;
87
88 constructor(repository: BaseRepository) {
89 this.#repository = repository;
90
91 this.kind = this.#repository.kind;
92 this.rootUri = Uri.file(this.#repository.root);
93 this.inputBox = new ApiInputBox(this.#repository.inputBox);
94 this.state = new ApiRepositoryState(this.#repository);
95 this.ui = new ApiRepositoryUIState(this.#repository.sourceControl);
96 this.isUsingVirtualFileSystem = this.#repository.isUsingVirtualFileSystem;
97
98 this.onDidCommit = mapEvent<OperationResult, void>(
99 filterEvent(this.#repository.onDidRunOperation, e => e.operation.kind === OperationKind.Commit), () => null);
100 this.onDidCheckout = mapEvent<OperationResult, void>(
101 filterEvent(this.#repository.onDidRunOperation, e => e.operation.kind === OperationKind.Checkout || e.operation.kind === OperationKind.CheckoutTracking), () => null);
102 }
103
104 apply(patch: string, reverse?: boolean): Promise<void>;
105 apply(patch: string, options?: { allowEmpty?: boolean; reverse?: boolean; threeWay?: boolean }): Promise<void>;
106 apply(patch: string, reverseOrOptions?: boolean | { allowEmpty?: boolean; reverse?: boolean; threeWay?: boolean }): Promise<void> {
107 const options = typeof reverseOrOptions === 'boolean' ? { reverse: reverseOrOptions } : reverseOrOptions;
108 return this.#repository.apply(patch, options);
109 }
110
111 getConfigs(): Promise<{ key: string; value: string }[]> {
112 return this.#repository.getConfigs();
113 }
114
115 getConfig(key: string): Promise<string> {
116 return this.#repository.getConfig(key);
117 }
118
119 setConfig(key: string, value: string): Promise<string> {
120 return this.#repository.setConfig(key, value);
121 }
122
123 unsetConfig(key: string): Promise<string> {
124 return this.#repository.unsetConfig(key);
125 }
126
127 getGlobalConfig(key: string): Promise<string> {
128 return this.#repository.getGlobalConfig(key);
129 }
130
131 getObjectDetails(treeish: string, path: string): Promise<{ mode: string; object: string; size: number }> {
132 return this.#repository.getObjectDetails(treeish, path);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…