Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 61aed0e

Browse files
committed
Change archive implementation to require the seek bound.
Only that way zip can be supported, and it seems not worth it to support non-seek versions of it.
1 parent b9b9e9e commit 61aed0e

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

gix/src/repository/worktree.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ impl crate::Repository {
110110
pub fn worktree_archive(
111111
&self,
112112
mut stream: gix_worktree_stream::Stream,
113-
out: impl std::io::Write,
113+
out: impl std::io::Write + std::io::Seek,
114114
mut blobs: impl gix_features::progress::Progress,
115115
should_interrupt: &std::sync::atomic::AtomicBool,
116116
options: gix_archive::Options,
@@ -123,7 +123,7 @@ impl crate::Repository {
123123
std::io::copy(&mut stream.into_read(), &mut out)?;
124124
return Ok(());
125125
}
126-
gix_archive::write_stream(
126+
gix_archive::write_stream_seek(
127127
&mut stream,
128128
|stream| {
129129
if should_interrupt.load(std::sync::atomic::Ordering::Relaxed) {

gix/tests/repository/worktree.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ fn archive() -> crate::Result {
2222

2323
repo.worktree_archive(
2424
stream,
25-
&mut buf,
25+
std::io::Cursor::new(&mut buf),
2626
gix_features::progress::Discard,
2727
&std::sync::atomic::AtomicBool::default(),
2828
Default::default(),

0 commit comments

Comments
 (0)