Function gix::discover

source ·
pub fn discover(directory: impl AsRef<Path>) -> Result<Repository, Error>
Expand description

See ThreadSafeRepository::discover(), but returns a Repository instead.

Note

The discovered repository might not be suitable for any operation that requires authentication with remotes as it doesn’t see the relevant git configuration.

To achieve that, one has to enable git_binary configuration in the open-options and use ThreadSafeRepository::discover_opts() instead. Alternatively, it might be well-known that the tool is going to run in a neatly configured environment without relying on bundled configuration.