ExGitEngine. GitRepo protocol
(ex_git_engine v0.9.0)
Copy Markdown
Protocol for implementing access to Git repositories.
Summary
Functions
Returns the agent for the given repo.
Validates ref updates before they are applied (pre-push hook). Called before push_cmds to allow custom validation logic. Return :ok to allow, {:error, reason} to reject the push. Optional callback - defaults to always allowing.
Executes after refs have been updated (post-push hook). Can optionally return advisory messages to send to the client. Returns {:ok, repo} or {:ok, repo, advisories :: [binary]} or {:error, term}
Types
@type t() :: term()
Functions
@spec get_agent(t()) :: {:ok, ExGitEngine.GitAgent.agent()} | {:error, term()}
Returns the agent for the given repo.
@spec pre_push(t(), [ExGitEngine.WireProtocol.ReceivePack.cmd()]) :: :ok | {:error, binary()}
Validates ref updates before they are applied (pre-push hook). Called before push_cmds to allow custom validation logic. Return :ok to allow, {:error, reason} to reject the push. Optional callback - defaults to always allowing.
@spec push(t(), [ExGitEngine.WireProtocol.ReceivePack.cmd()]) :: {:ok, t()} | {:ok, t(), [binary()]} | {:error, term()}
Executes after refs have been updated (post-push hook). Can optionally return advisory messages to send to the client. Returns {:ok, repo} or {:ok, repo, advisories :: [binary]} or {:error, term}