The git queries the planner needs, run in the project root through a runner function
(run/2 by default; tests pass their own). Paths are relative to the project root
(--relative), so a project in a subdirectory of its repository works.
Every failure is a usage error (exit 2): git missing, not a repository, or a ref that does not resolve. Nothing falls back silently to another scope.
Summary
Functions
Files changed since base (committed or not), relative to root.
The -U0 diff of the working tree against base for paths.
The merge base of ref and HEAD.
Runs git with args in root. Success returns stdout alone: git writes warnings (such
as core.autocrlf's "LF will be replaced by CRLF") to stderr, and merged into stdout they
would corrupt the -z path listings, so they pass through to the terminal instead. On
failure git runs again with stderr captured, for its message.
Untracked, not ignored files, relative to root.
Types
Functions
@spec changed_files(runner(), Path.t(), String.t()) :: {:ok, [String.t()]} | {:error, Juggernaut.Error.t()}
Files changed since base (committed or not), relative to root.
@spec diff(runner(), Path.t(), String.t(), [String.t()]) :: {:ok, String.t()} | {:error, Juggernaut.Error.t()}
The -U0 diff of the working tree against base for paths.
@spec merge_base(runner(), Path.t(), String.t()) :: {:ok, String.t()} | {:error, Juggernaut.Error.t()}
The merge base of ref and HEAD.
Runs git with args in root. Success returns stdout alone: git writes warnings (such
as core.autocrlf's "LF will be replaced by CRLF") to stderr, and merged into stdout they
would corrupt the -z path listings, so they pass through to the terminal instead. On
failure git runs again with stderr captured, for its message.
@spec untracked(runner(), Path.t()) :: {:ok, [String.t()]} | {:error, Juggernaut.Error.t()}
Untracked, not ignored files, relative to root.