Skip to main content

Module git

Module git 

Source
Expand description

The one place Alba talks to git: a thin wrapper over the git CLI.

Shelling out rather than linking a library is the same call the docker executor made: no native dependency, and git is present on any machine that has hooks to install. Every function takes the directory to run from; paths come back relative to it.

Structs§

GitError
A git invocation that could not answer: git missing from the PATH, no repository, an unknown reference. Carries git’s own words.
GitHead
What HEAD looks like right now.
KnownHook
A hook git knows, with the number of arguments it passes. Server-side hooks are left out: a developer’s clone never fires them.

Constants§

KNOWN_HOOKS

Functions§

changed_files
Every path that differs between reference and the working tree (committed since, staged, modified, deleted, renamed) plus every untracked file .gitignore does not exclude; relative to cwd, sorted, without duplicates. Paths outside cwd are not reported.
head
hooks_path
The repository-local core.hooksPath, if set.
known_hook
repository_root
The repository’s top-level directory, canonical.
set_hooks_path
unset_hooks_path