Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsTracked ¶
IsTracked reports whether the file at path is tracked by git in the given repo root. Returns (false, nil) if the file does not exist. Returns (false, error) on git errors (fail-closed).
func MainWorktreeRoot ¶ added in v0.9.0
MainWorktreeRoot returns the root of the main worktree when dir is inside a linked git worktree. Returns "" otherwise — main worktree itself, non-git directory, bare repo, or anywhere the detection is ambiguous. Never errors.
Types ¶
type Context ¶ added in v0.6.0
type Context struct {
Cwd string `json:"cwd"`
RepoRoot string `json:"repo_root,omitempty"`
GitDir string `json:"git_dir,omitempty"`
GitCommonDir string `json:"git_common_dir,omitempty"`
PrimaryCheckoutRoot string `json:"primary_checkout_root,omitempty"`
BranchName string `json:"branch_name,omitempty"`
IsWorktree bool `json:"is_worktree"`
}
Context is the cwd-derived git information ccgate exposes to the LLM. Targets stitch this onto their own per-tool payload (Claude adds referenced_paths, Codex forwards tool_input verbatim).
func BuildContext ¶ added in v0.6.0
BuildContext gathers git repository context for the given working directory. Each git lookup is best-effort: the function never errors out — fields stay empty when the corresponding `git` command fails or `cwd` is not in a git repo.