1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
//! Transports — moving smart-protocol bytes to and from a remote.
//!
//! The [`protocol`](crate::protocol) layer is sans-IO: it builds requests and
//! parses responses but never touches a socket. A [`Transport`] is the I/O
//! frontend that connects to a remote and exchanges the two service streams git
//! defines:
//!
//! - **`git-upload-pack`** — serves a fetch/clone: the client reads the ref
//! advertisement, sends its `want`/`have` negotiation, and receives a pack.
//! - **`git-receive-pack`** — accepts a push: the client reads the
//! advertisement, sends its ref-update commands and a pack, and reads the
//! report-status.
//!
//! Two implementations ship behind features:
//! - `http` (feature `http`) — smart HTTP(S) over `rsurl`.
//! - `ssh` (feature `ssh`) — runs the pack programs on a remote over
//! `puressh`.
//!
//! Both are being built out; the trait and the connection plumbing are defined
//! here so the client porcelain can be written against the interface.
use Vec;
use crateResult;
use crateRefAdvertisement;
/// Which pack service a transport request targets.
/// A connection to a remote repository over some concrete transport.
///
/// The lifecycle is: [`Transport::discover`] to read the ref advertisement,
/// then [`Transport::exchange`] to send the negotiation/command stream and read
/// the response (the pack, or the report-status). A single connection serves one
/// service; stateless transports (HTTP) reconnect per call internally.