Documentation
¶
Overview ¶
Package gitutil provides shared git operations to avoid spawning duplicate git processes. On Windows, each exec.Command costs 50-200ms due to CreateProcess overhead + antivirus scanning — this package consolidates all git calls into cached, process-spawn-efficient helpers.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InvalidateCache ¶ added in v0.1.54
func InvalidateCache(root string)
InvalidateCache clears the git metadata cache for a directory.
func IsGitRepo ¶
IsGitRepo reports whether root is inside a git working tree. Checks if the directory itself or any ancestor has a .git directory/file.
func LsFiles ¶
LsFiles returns tracked files via `git ls-files` as relative paths. Falls back to nil when git is unavailable or not a git repo. Result is cached per directory for the process lifetime.
func LsFilesAbs ¶
LsFilesAbs returns tracked files via `git ls-files` as absolute paths. Falls back to nil when git is unavailable or not a git repo. Result is cached per directory for the process lifetime.
Types ¶
This section is empty.