Protocol for git transports — HTTP, file, and user-defined (e.g. SSH
or in-memory). Any struct that implements this protocol can be used
interchangeably with Exgit.clone/2, Exgit.fetch/3, and
Exgit.push/3.
Required callbacks
capabilities/1— returns the server's advertised capability map.ls_refs/2— lists refs with optionalprefix:filters. Returns{:ok, refs, meta}whererefsis always a list of{ref_name, sha}2-tuples andmetacarries protocol-v2 side- channel data (HEAD symref target, peeled tag targets, etc.).fetch/3— returns{:ok, pack_bytes, summary}givenwantsand optionalhaves:/depth:.push/4— performs ref updates and sends the given pack.
Summary
Types
@type ls_refs_meta() :: %{ optional(:head) => String.t(), optional(:peeled) => %{required(String.t()) => binary()} }
Side-channel metadata from an ls_refs/2 call. Keys:
:head— the ref name that HEAD symbolically points at (e.g."refs/heads/main"), when the server advertises it via protocol-v2symrefs. Absent for servers that don't, or for repositories with a detached HEAD.:peeled—%{tag_ref => peeled_target_sha}. Only populated for annotated tags when the server sendspeeled:<sha>in the ls-refs response. Useful forhavenegotiation.
Additional keys may be added in future versions; consumers should treat the map as open.
@type t() :: term()
All the types that implement this protocol.