Skip to content

discoverRepository ​

Attempt to open an already-existing repository at or above path.

This starts at path and looks up the filesystem hierarchy until it finds a repository.

Signature ​

ts
function discoverRepository(path: string, signal?: AbortSignal | null | undefined): Promise<Repository>;

Parameters ​

  • pathrequired · string

    Directory path to discover repository.

  • signalnull | AbortSignal

    Abort signal.

Returns ​

  • Promise<Repository>

    Git repository.

Released under the MIT License.