MCPcopy Index your code
hub / github.com/generalaction/emdash / acquireRepository

Method acquireRepository

packages/core/src/git/git-runtime.ts:201–219  ·  view source on GitHub ↗
(identity: GitIdentity)

Source from the content-addressed store, hash-verified

199 }
200
201 private async acquireRepository(identity: GitIdentity): Promise<Lease<GitRepository>> {
202 return this.repositories.acquire(identity.gitCommonDir, async () => {
203 const repository = new GitRepository({
204 gitCommonDir: identity.gitCommonDir,
205 objectStoreDir: identity.objectStoreDir,
206 exec: this.exec.withCwd(identity.topLevel),
207 watcher: this.watcher,
208 objectStoreMutex: this.mutex,
209 onError: this.onError,
210 });
211 try {
212 await repository.ready();
213 } catch (error) {
214 await repository.dispose();
215 throw error;
216 }
217 return repository;
218 });
219 }
220
221 private async resolveIdentity(pathInsideRepo: string): Promise<GitIdentity> {
222 const cwd = path.resolve(pathInsideRepo);

Callers 2

openRepositoryMethod · 0.95
openWorktreeMethod · 0.95

Calls 4

readyMethod · 0.95
disposeMethod · 0.95
acquireMethod · 0.65
withCwdMethod · 0.45

Tested by

no test coverage detected