Only that way zip can be supported, and it seems not worth it to support non-seek versions of it.
Unified · Split
| @@ -110,7 +110,7 @@ impl crate::Repository { · 109 unmodified lines | ||
| 110 | 110 | pub fn worktree_archive( |
| 111 | 111 | &self, |
| 112 | 112 | mut stream: gix_worktree_stream::Stream, |
| 113 | − out: impl std::io::Write, | |
| 113 | + out: impl std::io::Write + std::io::Seek, | |
| 114 | 114 | mut blobs: impl gix_features::progress::Progress, |
| 115 | 115 | should_interrupt: &std::sync::atomic::AtomicBool, |
| 116 | 116 | options: gix_archive::Options, |
| @@ -123,7 +123,7 @@ impl crate::Repository { · 6 unmodified lines | ||
| 123 | 123 | std::io::copy(&mut stream.into_read(), &mut out)?; |
| 124 | 124 | return Ok(()); |
| 125 | 125 | } |
| 126 | − gix_archive::write_stream( | |
| 126 | + gix_archive::write_stream_seek( | |
| 127 | 127 | &mut stream, |
| 128 | 128 | |stream| { |
| 129 | 129 | if should_interrupt.load(std::sync::atomic::Ordering::Relaxed) { |
| @@ -22,7 +22,7 @@ fn archive() -> crate::Result { · 21 unmodified lines | ||
| 22 | 22 | |
| 23 | 23 | repo.worktree_archive( |
| 24 | 24 | stream, |
| 25 | − &mut buf, | |
| 25 | + std::io::Cursor::new(&mut buf), | |
| 26 | 26 | gix_features::progress::Discard, |
| 27 | 27 | &std::sync::atomic::AtomicBool::default(), |
| 28 | 28 | Default::default(), |