Documentation for Simbo's Packages
    Preparing search index...
    • 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.

      Parameters

      • workingDir: string = ...

        The directory from which to find the root. Defaults to the current working directory.

      Returns Promise<string | undefined>

      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.

      if Git cannot be started or is terminated.