History

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.

Sebastian Thiel committed 3 years ago

Commit 61aed0e1 parent b9b9e9e2 files · +3 −3Browse files

Unified · Split

2 files
  1. gix/src/repository/worktree.rs +2 −2
  2. gix/tests/repository/worktree.rs +1 −1
gix/src/repository/worktree.rs+2−2
@@ -110,7 +110,7 @@ impl crate::Repository { · 109 unmodified lines
110 pub fn worktree_archive(110 pub fn worktree_archive(
111 &self,111 &self,
112 mut stream: gix_worktree_stream::Stream,112 mut stream: gix_worktree_stream::Stream,
113 out: impl std::io::Write,113 out: impl std::io::Write + std::io::Seek,
114 mut blobs: impl gix_features::progress::Progress,114 mut blobs: impl gix_features::progress::Progress,
115 should_interrupt: &std::sync::atomic::AtomicBool,115 should_interrupt: &std::sync::atomic::AtomicBool,
116 options: gix_archive::Options,116 options: gix_archive::Options,
@@ -123,7 +123,7 @@ impl crate::Repository { · 6 unmodified lines
123 std::io::copy(&mut stream.into_read(), &mut out)?;123 std::io::copy(&mut stream.into_read(), &mut out)?;
124 return Ok(());124 return Ok(());
125 }125 }
126 gix_archive::write_stream(126 gix_archive::write_stream_seek(
127 &mut stream,127 &mut stream,
128 |stream| {128 |stream| {
129 if should_interrupt.load(std::sync::atomic::Ordering::Relaxed) {129 if should_interrupt.load(std::sync::atomic::Ordering::Relaxed) {
gix/tests/repository/worktree.rs+1−1
@@ -22,7 +22,7 @@ fn archive() -> crate::Result { · 21 unmodified lines
22 22
23 repo.worktree_archive(23 repo.worktree_archive(
24 stream,24 stream,
25 &mut buf,25 std::io::Cursor::new(&mut buf),
26 gix_features::progress::Discard,26 gix_features::progress::Discard,
27 &std::sync::atomic::AtomicBool::default(),27 &std::sync::atomic::AtomicBool::default(),
28 Default::default(),28 Default::default(),

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t