Help us shape the future of Go! Take the 2026 Go Developer Survey

gitutil

package
v0.1.52 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 27, 2026 License: MIT Imports: 4 Imported by: 0

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 IsGitRepo

func IsGitRepo(root string) bool

IsGitRepo reports whether root is inside a git working tree. Result is cached per directory for the process lifetime.

func LsFiles

func LsFiles(root string) []string

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

func LsFilesAbs(root string) []string

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL