@@ -41,7 +41,7 @@ pub mod invoke {
4141 #[ error( "Failed to read or write to the process" ) ]
4242 Io ( #[ from] std:: io:: Error ) ,
4343 #[ error( transparent) ]
44- PacketlineDecode ( #[ from] gix_packetline :: decode:: Error ) ,
44+ PacketlineDecode ( #[ from] gix_packetline_blocking :: decode:: Error ) ,
4545 }
4646
4747 impl From < super :: Error > for Error {
@@ -65,17 +65,18 @@ impl Client {
6565 versions : & [ usize ] ,
6666 desired_capabilities : & [ & str ] ,
6767 ) -> Result < Self , handshake:: Error > {
68- let mut out = gix_packetline:: Writer :: new ( process. stdin . take ( ) . expect ( "configured stdin when spawning" ) ) ;
68+ let mut out =
69+ gix_packetline_blocking:: Writer :: new ( process. stdin . take ( ) . expect ( "configured stdin when spawning" ) ) ;
6970 out. write_all ( format ! ( "{welcome_prefix}-client" ) . as_bytes ( ) ) ?;
7071 for version in versions {
7172 out. write_all ( format ! ( "version={version}" ) . as_bytes ( ) ) ?;
7273 }
73- gix_packetline :: encode:: flush_to_write ( out. inner_mut ( ) ) ?;
74+ gix_packetline_blocking :: encode:: flush_to_write ( out. inner_mut ( ) ) ?;
7475 out. flush ( ) ?;
7576
76- let mut input = gix_packetline :: StreamingPeekableIter :: new (
77+ let mut input = gix_packetline_blocking :: StreamingPeekableIter :: new (
7778 process. stdout . take ( ) . expect ( "configured stdout when spawning" ) ,
78- & [ gix_packetline :: PacketLineRef :: Flush ] ,
79+ & [ gix_packetline_blocking :: PacketLineRef :: Flush ] ,
7980 false , /* packet tracing */
8081 ) ;
8182 let mut read = input. as_read ( ) ;
@@ -125,10 +126,10 @@ impl Client {
125126 for capability in desired_capabilities {
126127 out. write_all ( format ! ( "capability={capability}" ) . as_bytes ( ) ) ?;
127128 }
128- gix_packetline :: encode:: flush_to_write ( out. inner_mut ( ) ) ?;
129+ gix_packetline_blocking :: encode:: flush_to_write ( out. inner_mut ( ) ) ?;
129130 out. flush ( ) ?;
130131
131- read. reset_with ( & [ gix_packetline :: PacketLineRef :: Flush ] ) ;
132+ read. reset_with ( & [ gix_packetline_blocking :: PacketLineRef :: Flush ] ) ;
132133 let mut capabilities = HashSet :: new ( ) ;
133134 loop {
134135 buf. clear ( ) ;
@@ -167,7 +168,7 @@ impl Client {
167168 ) -> Result < process:: Status , invoke:: Error > {
168169 self . send_command_and_meta ( command, meta) ?;
169170 std:: io:: copy ( content, & mut self . input ) ?;
170- gix_packetline :: encode:: flush_to_write ( self . input . inner_mut ( ) ) ?;
171+ gix_packetline_blocking :: encode:: flush_to_write ( self . input . inner_mut ( ) ) ?;
171172 self . input . flush ( ) ?;
172173 Ok ( self . read_status ( ) ?)
173174 }
@@ -189,15 +190,15 @@ impl Client {
189190 inspect_line ( line. as_bstr ( ) ) ;
190191 }
191192 }
192- self . out . reset_with ( & [ gix_packetline :: PacketLineRef :: Flush ] ) ;
193+ self . out . reset_with ( & [ gix_packetline_blocking :: PacketLineRef :: Flush ] ) ;
193194 let status = self . read_status ( ) ?;
194195 Ok ( status)
195196 }
196197
197198 /// Return a `Read` implementation that reads the server process output until the next flush package, and validates
198199 /// the status. If the status indicates failure, the last read will also fail.
199200 pub fn as_read ( & mut self ) -> impl std:: io:: Read + ' _ {
200- self . out . reset_with ( & [ gix_packetline :: PacketLineRef :: Flush ] ) ;
201+ self . out . reset_with ( & [ gix_packetline_blocking :: PacketLineRef :: Flush ] ) ;
201202 ReadProcessOutputAndStatus {
202203 inner : self . out . as_read ( ) ,
203204 }
@@ -225,7 +226,7 @@ impl Client {
225226 buf. push_str ( & value) ;
226227 self . input . write_all ( & buf) ?;
227228 }
228- gix_packetline :: encode:: flush_to_write ( self . input . inner_mut ( ) ) ?;
229+ gix_packetline_blocking :: encode:: flush_to_write ( self . input . inner_mut ( ) ) ?;
229230 Ok ( ( ) )
230231 }
231232}
@@ -248,7 +249,7 @@ fn read_status(read: &mut PacketlineReader<'_>) -> std::io::Result<process::Stat
248249 if count > 0 && matches ! ( status, process:: Status :: Previous ) {
249250 status = process:: Status :: Unset ;
250251 }
251- read. reset_with ( & [ gix_packetline :: PacketLineRef :: Flush ] ) ;
252+ read. reset_with ( & [ gix_packetline_blocking :: PacketLineRef :: Flush ] ) ;
252253 Ok ( status)
253254}
254255
@@ -260,7 +261,7 @@ impl std::io::Read for ReadProcessOutputAndStatus<'_> {
260261 fn read ( & mut self , buf : & mut [ u8 ] ) -> std:: io:: Result < usize > {
261262 let num_read = self . inner . read ( buf) ?;
262263 if num_read == 0 {
263- self . inner . reset_with ( & [ gix_packetline :: PacketLineRef :: Flush ] ) ;
264+ self . inner . reset_with ( & [ gix_packetline_blocking :: PacketLineRef :: Flush ] ) ;
264265 let status = read_status ( & mut self . inner ) ?;
265266 if status. is_success ( ) {
266267 Ok ( 0 )
0 commit comments