Skip to main content

Module path

Module path 

Source
Expand description

Repository path discovery.

Functions§

git_dir
Path to the .git directory of the repository containing cwd. Always returns an absolute path. Errors if cwd isn’t inside a git repository.
lfs_alternate_dirs
LFS-objects directories belonging to alternate object stores referenced by this repository. Used to satisfy a git lfs smudge or git lfs fetch from a git clone --shared <source> checkout without re-downloading bytes the source already has.
lfs_dir
Path to the LFS storage directory for the repository (<git-dir>/lfs). The directory is not created.
work_tree_root
Path to the working-tree root of the repository containing cwd. Honors GIT_WORK_TREE, so this returns the right thing even when cwd is outside the work tree (e.g. tests that set both GIT_DIR and GIT_WORK_TREE as relative paths from a parent dir). Errors for bare repos (no work tree) and outside-any-repo callers.