Skip to content

Commit de8ca41

Browse files
committed
adapt to changes in gix-object and gix-odb
1 parent 1698449 commit de8ca41

File tree

6 files changed

+14
-13
lines changed

6 files changed

+14
-13
lines changed

gitoxide-core/src/pack/explode.rs

+5-4
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ use anyhow::{anyhow, Result};
99
use gix::{
1010
hash::ObjectId,
1111
object, objs, odb,
12-
odb::{loose, pack, Write},
12+
odb::{loose, pack},
13+
prelude::Write,
1314
NestedProgress,
1415
};
1516

@@ -96,8 +97,8 @@ enum OutputWriter {
9697
Sink(odb::Sink),
9798
}
9899

99-
impl gix::odb::Write for OutputWriter {
100-
fn write_buf(&self, kind: object::Kind, from: &[u8]) -> Result<ObjectId, gix::odb::write::Error> {
100+
impl gix::objs::Write for OutputWriter {
101+
fn write_buf(&self, kind: object::Kind, from: &[u8]) -> Result<ObjectId, gix::objs::write::Error> {
101102
match self {
102103
OutputWriter::Loose(db) => db.write_buf(kind, from),
103104
OutputWriter::Sink(db) => db.write_buf(kind, from),
@@ -109,7 +110,7 @@ impl gix::odb::Write for OutputWriter {
109110
kind: object::Kind,
110111
size: u64,
111112
from: &mut dyn Read,
112-
) -> Result<ObjectId, gix::odb::write::Error> {
113+
) -> Result<ObjectId, gix::objs::write::Error> {
113114
match self {
114115
OutputWriter::Loose(db) => db.write_stream(kind, size, from),
115116
OutputWriter::Sink(db) => db.write_stream(kind, size, from),

gix-object/src/traits/mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,18 @@ use crate::Kind;
44

55
/// Describe the capability to write git objects into an object store.
66
pub trait Write {
7-
/// Write objects using the intrinsic kind of [`hash`][gix_hash::Kind] into the database,
7+
/// Write objects using the intrinsic kind of [`hash`](gix_hash::Kind) into the database,
88
/// returning id to reference it in subsequent reads.
99
fn write(&self, object: &dyn WriteTo) -> Result<gix_hash::ObjectId, crate::write::Error> {
1010
let mut buf = Vec::with_capacity(2048);
1111
object.write_to(&mut buf)?;
1212
self.write_stream(object.kind(), buf.len() as u64, &mut buf.as_slice())
1313
}
14-
/// As [`write`][Write::write], but takes an [`object` kind][gix_object::Kind] along with its encoded bytes.
14+
/// As [`write`](Write::write), but takes an [`object` kind](Kind) along with its encoded bytes.
1515
fn write_buf(&self, object: crate::Kind, mut from: &[u8]) -> Result<gix_hash::ObjectId, crate::write::Error> {
1616
self.write_stream(object, from.len() as u64, &mut from)
1717
}
18-
/// As [`write`][Write::write], but takes an input stream.
18+
/// As [`write`](Write::write), but takes an input stream.
1919
/// This is commonly used for writing blobs directly without reading them to memory first.
2020
fn write_stream(
2121
&self,

gix-odb/src/store_impls/dynamic/write.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use crate::store;
88
mod error {
99
use crate::{loose, store};
1010

11-
/// The error returned by the [dynamic Store's][crate::Store] [`Write`][crate::Write] implementation.
11+
/// The error returned by the [dynamic Store's][crate::Store] [`Write`](gix_object::Write) implementation.
1212
#[derive(Debug, thiserror::Error)]
1313
#[allow(missing_docs)]
1414
pub enum Error {

gix-odb/src/store_impls/loose/write.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use tempfile::NamedTempFile;
77
use super::Store;
88
use crate::store_impls::loose;
99

10-
/// Returned by the [`crate::Write`] trait implementation of [`Store`]
10+
/// Returned by the [`gix_object::Write`] trait implementation of [`Store`]
1111
#[derive(thiserror::Error, Debug)]
1212
#[allow(missing_docs)]
1313
pub enum Error {

gix/src/prelude.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
pub use gix_features::parallel::reduce::Finalize;
2-
pub use gix_object::{Find, FindExt};
3-
pub use gix_odb::{Header, HeaderExt, Write};
2+
pub use gix_object::{Find, FindExt, Write};
3+
pub use gix_odb::{Header, HeaderExt};
44

55
pub use crate::ext::*;

gix/src/repository/object.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
use std::ops::DerefMut;
33

44
use gix_hash::ObjectId;
5-
use gix_object::{Exists, Find, FindExt};
6-
use gix_odb::{Header, HeaderExt, Write};
5+
use gix_object::{Exists, Find, FindExt, Write};
6+
use gix_odb::{Header, HeaderExt};
77
use gix_ref::{
88
transaction::{LogChange, PreviousValue, RefLog},
99
FullName,

0 commit comments

Comments
 (0)