pub struct SmartHttpTransport<C: HttpClient> { /* private fields */ }Expand description
A smart-HTTP Transport over a pluggable HttpClient.
Transport::connect performs the info/refs?service=git-upload-pack
discovery GET and parses the advertisement; the returned Connection
exposes the advertised refs/capabilities. Use http_fetch to drive the
fetch negotiation over the same client.
Implementations§
Source§impl<C: HttpClient> SmartHttpTransport<C>
impl<C: HttpClient> SmartHttpTransport<C>
Sourcepub fn push(
&self,
local_git_dir: &Path,
repo_url: &str,
refs: &[PushRefSpec],
opts: &PushOptions,
progress: &mut dyn Progress,
) -> Result<PushOutcome>
pub fn push( &self, local_git_dir: &Path, repo_url: &str, refs: &[PushRefSpec], opts: &PushOptions, progress: &mut dyn Progress, ) -> Result<PushOutcome>
Push refs to repo_url over smart HTTP (git-receive-pack), returning a
crate::transfer::PushOutcome.
This is the push counterpart to http_fetch: it discovers the
receive-pack advertisement, decides each update, builds the command block +
pack, POSTs git-receive-pack, and parses the report-status reply —
reusing the same decision/pack/report machinery as the duplex
crate::push::push_remote. Delegates to crate::push::push_http.
Protocol v0/v1 only (a v2 receive-pack advertisement is rejected).
§Errors
Returns an error if discovery fails, the advertisement is protocol v2, a source object is missing locally, the pack build fails, or on wire/parse I/O failure.
Trait Implementations§
Source§impl<C: HttpClient> Transport for SmartHttpTransport<C>
impl<C: HttpClient> Transport for SmartHttpTransport<C>
Source§fn connect(
&self,
url: &str,
service: Service,
opts: &ConnectOptions,
) -> Result<Box<dyn Connection>>
fn connect( &self, url: &str, service: Service, opts: &ConnectOptions, ) -> Result<Box<dyn Connection>>
url for service, performing the handshake described by
opts, and return a live Connection positioned just past the
advertisement. Read more