The directory from which to find the root. Defaults to the current working directory.
A promise that resolves to the absolute path of the root, or undefined if the directory is not inside a
working tree, for example outside a repository, in a bare repository or in the .git directory, or if it does not
exist or is not a directory.
Finds the root directory of the Git working tree that contains the given directory.
Asks Git for the top-level directory with
git rev-parse --show-toplevel. Inside a linked worktree or a submodule, this is the root of the worktree or submodule. Git resolves symbolic links, so the path is canonical.