Documentation
¶
Overview ¶
Package gitenv builds environments for invoking git as a subprocess.
Git exports its repository-discovery variables to every hook it runs, so any process a hook starts inherits them — including `go test ./...` run by a pre-commit hook. Those variables take precedence over a `-C <dir>` argument, so an inheriting subprocess operates on the hook's repository rather than the directory it was pointed at. For a test that runs `git init` in a temporary fixture, that means re-initializing the developer's own checkout.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithoutDiscovery ¶
func WithoutDiscovery() []string
WithoutDiscovery returns the current process environment with every repository-discovery variable removed, so git resolves the repository from the directory it is given. Assign it to exec.Cmd.Env whenever a git subprocess is pointed at a specific directory.
Types ¶
This section is empty.