ExGitEngine. WireProtocol. ReceivePack
(ex_git_engine v0.9.1)
Copy Markdown
Module implementing the git-receive-pack command.
Summary
Functions
Builds the complete push response combining status and hook messages.
Parses capabilities from the first reference line.
Parses ref update commands from the client.
Builds the push response output for successful operations.
Generates report-status response for successful ref updates.
Wraps a line with sideband framing for multiplexed transmission.
Validates a push command against the current repository state.
Types
@type cmd() :: {:create, ExGitEngine.Git.oid(), binary()} | {:update, ExGitEngine.Git.oid(), ExGitEngine.Git.oid(), binary()} | {:delete, ExGitEngine.Git.oid(), binary()}
@type t() :: %ExGitEngine.WireProtocol.ReceivePack{ advertised_caps: term(), agent: ExGitEngine.GitAgent.agent(), client_caps: [binary()], cmds: [cmd()], repo: ExGitEngine.GitRepo.t(), state: :disco | :update_req | :pack | :buffer | :done, writepack: ExGitEngine.GitWritePack.t(), writepack_progress: ExGitEngine.Git.odb_writepack_progress() }
Functions
Builds the complete push response combining status and hook messages.
Assembles status output with optional hook messages, handling sideband multiplexing when advertised.
Parses capabilities from the first reference line.
Extracts client capabilities from the null-delimited first ref line. Returns a tuple of {capabilities, refs}.
Parses ref update commands from the client.
Converts command strings into structured tuples representing create, delete, or update operations.
Builds the push response output for successful operations.
Returns status tuples optionally wrapped in sideband format if the client advertised support for it.
Generates report-status response for successful ref updates.
Returns tuples indicating successful update status for each ref command.
Wraps a line with sideband framing for multiplexed transmission.
Encodes the line with the specified band number in PKT-LINE format.
Validates a push command against the current repository state.
For :update commands, checks that the client's old_oid matches the
current ref (stale-ref / force-with-lease semantics) and that new_oid
is a fast-forward of the current tip.