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
//! The seam every wire conversation in this crate runs over: **a blocking
//! reader and a blocking writer**.
//!
//! That is all git-over-SSH is. The remote runs `git-receive-pack` with its
//! stdin and stdout wired to a channel, and the client talks to those two
//! pipes. Nothing above this module knows or cares whether the bytes travel
//! over SSH, over a socketpair, or over a `Vec<u8>` in a unit test, which is
//! exactly why [`send_pack`](crate::send_pack) is proved against the real
//! `git receive-pack` binary without an sshd.
//!
//! # Why the trait yields both halves at once
//!
//! Push is not request/response. The command list is written, the packfile
//! follows it, and `receive-pack` may start reporting (or fail loudly on band
//! 3) while the pack is still being written. A trait that handed out the reader
//! and the writer through separate `&mut self` calls could not hold both, so
//! [`Transport::io`] returns the disjoint pair in one borrow.
use ;
/// A bidirectional blocking byte stream to a remote git command.
/// Any `(Read, Write)` pair as a [`Transport`].
///
/// The escape hatch for anything already holding two halves: a pair of pipes to
/// a child process, a `TcpStream` split, or a pair of in-memory buffers.