Skip to content

Commit 318bf82

Browse files
committed
Wrap native error in io::Error when write fails
Unlike for `OdbPackwriter`, we always get the native error code here.
1 parent 2e95ccb commit 318bf82

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/indexer.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -192,9 +192,11 @@ impl io::Write for Indexer<'_> {
192192
let len = buf.len();
193193

194194
let res = raw::git_indexer_append(self.raw, ptr, len, self.progress.as_mut_ptr());
195-
196195
if res < 0 {
197-
Err(io::Error::new(io::ErrorKind::Other, "Write error"))
196+
Err(io::Error::new(
197+
io::ErrorKind::Other,
198+
Error::last_error(res).unwrap(),
199+
))
198200
} else {
199201
Ok(buf.len())
200202
}

0 commit comments

Comments
 (0)