Skip to main content

push_all

Function push_all 

Source
pub fn push_all(cwd: &Path, tx: &dyn Transport) -> Result<usize, DispatchError>
Expand description

Push every ref under refs/heads/ to the remote, assembling a pack of every object reachable from the branch tip that the remote does not already hold. Returns the count of refs pushed.

Per-ref flow:

  1. Resolve the local branch tip.
  2. Walk reachable objects (ops::reachable_objects).
  3. Filter out any object the remote already has via Transport::pack_exists (single-object packs, so the digest == pack key).
  4. Build a pack with PackWriter; the whole-pack digest is the PackKey used by Transport::upload_pack.
  5. Publish the ref with Transport::write_ref.