import type { MountRoot, StatPath } from '../../../../ops/types.ts'; import type { Dispatch, RepoLocation } from './types.ts'; /** * Find the repository governing a path, or throw git's own fatal. * * Walks up from `start` looking for a `.git` entry, stopping at the mount root. * Real git stops discovery at a filesystem boundary unless * GIT_DISCOVERY_ACROSS_FILESYSTEM is set, and a mount prefix is exactly that * boundary: crossing it would probe a different backend for a repository that * has nothing to do with the operand. * * Existence comes from `statPath` rather than one backend's stat because on a * prefix store a directory is not an object: `.git` answers on readdir while a * point lookup misses it entirely. That is the same fact `find` asks about its * own start point. * * What is found is not always the git directory. A `.git` file points at one * elsewhere, and the directory it points at may share its objects with another, * so the three paths are resolved here and carried separately rather than * derived again by each verb. * * @param dispatch workspace op dispatcher, for the two files that redirect a git * directory * @param statPath dispatcher-backed stat asking both channels a backend can * answer on; null means nothing is there * @param mountRoot the mount prefix serving a path * @param start absolute virtual path to start from, normally the session cwd or * the argument of `-C` */ export declare function discover(dispatch: Dispatch, statPath: StatPath, mountRoot: MountRoot, start: string): Promise; //# sourceMappingURL=discover.d.ts.map