…so that it always comes from git-object if possible, and so that major users like git-ref re-export it. The re-export is really something to possibly change to put that onto git-repository level, as well.
Unified · Split
| @@ -1165,7 +1165,6 @@ dependencies = [ · 1164 unmodified lines | |||
| 1165 | name = "git-ref" | 1165 | name = "git-ref" |
| 1166 | version = "0.7.0" | 1166 | version = "0.7.0" |
| 1167 | dependencies = [ | 1167 | dependencies = [ |
| 1168 | "bstr", | ||
| 1169 | "filebuffer", | 1168 | "filebuffer", |
| 1170 | "git-actor", | 1169 | "git-actor", |
| 1171 | "git-features", | 1170 | "git-features", |
| @@ -1188,7 +1187,6 @@ name = "git-repository" · 16 unmodified lines | |||
| 1188 | version = "0.8.1" | 1187 | version = "0.8.1" |
| 1189 | dependencies = [ | 1188 | dependencies = [ |
| 1190 | "anyhow", | 1189 | "anyhow", |
| 1191 | "bstr", | ||
| 1192 | "git-actor", | 1190 | "git-actor", |
| 1193 | "git-config", | 1191 | "git-config", |
| 1194 | "git-diff", | 1192 | "git-diff", |
| @@ -13,7 +13,7 @@ doctest = false · 12 unmodified lines | |||
| 13 | test = true | 13 | test = true |
| 14 | 14 | ||
| 15 | [features] | 15 | [features] |
| 16 | serde1 = ["serde", "bstr/serde1", "git-hash/serde1", "git-actor/serde1"] | 16 | serde1 = ["serde", "git-hash/serde1", "git-actor/serde1", "git-object/serde1"] |
| 17 | internal-testing-git-features-parallel = ["git-features/parallel"] # test sorted parallel loose file traversal | 17 | internal-testing-git-features-parallel = ["git-features/parallel"] # test sorted parallel loose file traversal |
| 18 | 18 | ||
| 19 | [[test]] | 19 | [[test]] |
| @@ -33,7 +33,6 @@ git-lock = { version ="^1.0.0", path = "../git-lock" } · 13 unmodified lines | |||
| 33 | git-tempfile = { version ="^1.0.0", path = "../git-tempfile" } | 33 | git-tempfile = { version ="^1.0.0", path = "../git-tempfile" } |
| 34 | 34 | ||
| 35 | quick-error = "2.0.0" | 35 | quick-error = "2.0.0" |
| 36 | bstr = { version = "0.2.13", default-features = false, features = ["std"] } | ||
| 37 | nom = { version = "7", default-features = false, features = ["std"]} | 36 | nom = { version = "7", default-features = false, features = ["std"]} |
| 38 | serde = { version = "1.0.114", optional = true, default-features = false, features = ["derive"]} | 37 | serde = { version = "1.0.114", optional = true, default-features = false, features = ["derive"]} |
| 39 | os_str_bytes = "3.1.0" | 38 | os_str_bytes = "3.1.0" |
| @@ -1,6 +1,6 @@ | |||
| 1 | use std::{borrow::Cow, convert::TryFrom, path::Path}; | 1 | use std::{borrow::Cow, convert::TryFrom, path::Path}; |
| 2 | 2 | ||
| 3 | use bstr::{BStr, BString, ByteSlice}; | 3 | use git_object::bstr::{BStr, BString, ByteSlice}; |
| 4 | 4 | ||
| 5 | use crate::{FullName, FullNameRef}; | 5 | use crate::{FullName, FullNameRef}; |
| 6 | 6 | ||
| @@ -18,8 +18,9 @@ · 17 unmodified lines | |||
| 18 | //! * supersedes all of the above to allow handling hundreds of thousands of references. | 18 | //! * supersedes all of the above to allow handling hundreds of thousands of references. |
| 19 | #![forbid(unsafe_code)] | 19 | #![forbid(unsafe_code)] |
| 20 | #![deny(missing_docs, rust_2018_idioms)] | 20 | #![deny(missing_docs, rust_2018_idioms)] |
| 21 | use bstr::{BStr, BString}; | ||
| 22 | use git_hash::{oid, ObjectId}; | 21 | use git_hash::{oid, ObjectId}; |
| 22 | pub use git_object::bstr; | ||
| 23 | use git_object::bstr::{BStr, BString}; | ||
| 23 | 24 | ||
| 24 | mod store; | 25 | mod store; |
| 25 | pub use store::{file, packed}; | 26 | pub use store::{file, packed}; |
| @@ -41,8 +42,8 @@ mod target; · 15 unmodified lines | |||
| 41 | 42 | ||
| 42 | /// | 43 | /// |
| 43 | pub mod log { | 44 | pub mod log { |
| 44 | use bstr::BString; | ||
| 45 | use git_hash::ObjectId; | 45 | use git_hash::ObjectId; |
| 46 | use git_object::bstr::BString; | ||
| 46 | 47 | ||
| 47 | /// A parsed ref log line that can be changed | 48 | /// A parsed ref log line that can be changed |
| 48 | #[derive(PartialEq, Eq, Debug, Hash, Ord, PartialOrd, Clone)] | 49 | #[derive(PartialEq, Eq, Debug, Hash, Ord, PartialOrd, Clone)] |
| @@ -4,7 +4,7 @@ use std::{ · 3 unmodified lines | |||
| 4 | path::Path, | 4 | path::Path, |
| 5 | }; | 5 | }; |
| 6 | 6 | ||
| 7 | use bstr::{BStr, ByteSlice}; | 7 | use git_object::bstr::{BStr, ByteSlice}; |
| 8 | 8 | ||
| 9 | use crate::{FullNameRef, PartialNameRef}; | 9 | use crate::{FullNameRef, PartialNameRef}; |
| 10 | 10 | ||
| @@ -1,6 +1,6 @@ | |||
| 1 | use std::{borrow::Cow, convert::TryInto, path::Path}; | 1 | use std::{borrow::Cow, convert::TryInto, path::Path}; |
| 2 | 2 | ||
| 3 | use bstr::{BStr, BString, ByteSlice, ByteVec}; | 3 | use git_object::bstr::{BStr, BString, ByteSlice, ByteVec}; |
| 4 | 4 | ||
| 5 | use crate::{Namespace, PartialNameRef}; | 5 | use crate::{Namespace, PartialNameRef}; |
| 6 | 6 | ||
| @@ -1,4 +1,4 @@ | |||
| 1 | use bstr::{BStr, ByteSlice}; | 1 | use git_object::bstr::{BStr, ByteSlice}; |
| 2 | use nom::{ | 2 | use nom::{ |
| 3 | branch::alt, | 3 | branch::alt, |
| 4 | bytes::complete::{tag, take_while_m_n}, | 4 | bytes::complete::{tag, take_while_m_n}, |
| @@ -10,7 +10,7 @@ pub fn none( · 9 unmodified lines | |||
| 10 | pub mod to_id { | 10 | pub mod to_id { |
| 11 | use std::path::PathBuf; | 11 | use std::path::PathBuf; |
| 12 | 12 | ||
| 13 | use bstr::BString; | 13 | use git_object::bstr::BString; |
| 14 | use quick_error::quick_error; | 14 | use quick_error::quick_error; |
| 15 | 15 | ||
| 16 | use crate::file; | 16 | use crate::file; |
| @@ -55,7 +55,7 @@ mod convert { · 54 unmodified lines | |||
| 55 | } | 55 | } |
| 56 | 56 | ||
| 57 | mod access { | 57 | mod access { |
| 58 | use bstr::ByteSlice; | 58 | use git_object::bstr::ByteSlice; |
| 59 | 59 | ||
| 60 | use crate::{raw::Reference, FullNameRef, Namespace}; | 60 | use crate::{raw::Reference, FullNameRef, Namespace}; |
| 61 | 61 | ||
| @@ -4,8 +4,8 @@ use std::{ · 3 unmodified lines | |||
| 4 | path::{Path, PathBuf}, | 4 | path::{Path, PathBuf}, |
| 5 | }; | 5 | }; |
| 6 | 6 | ||
| 7 | use bstr::ByteSlice; | ||
| 8 | pub use error::Error; | 7 | pub use error::Error; |
| 8 | use git_object::bstr::ByteSlice; | ||
| 9 | 9 | ||
| 10 | use crate::{ | 10 | use crate::{ |
| 11 | file, | 11 | file, |
| @@ -1,4 +1,4 @@ | |||
| 1 | use bstr::ByteSlice; | 1 | use git_object::bstr::ByteSlice; |
| 2 | 2 | ||
| 3 | use crate::store::file::{log, log::iter::decode::LineNumber}; | 3 | use crate::store::file::{log, log::iter::decode::LineNumber}; |
| 4 | 4 | ||
| @@ -59,7 +59,7 @@ pub fn forward(lines: &[u8]) -> Forward<'_> { · 54 unmodified lines | |||
| 59 | 59 | ||
| 60 | /// An iterator yielding parsed lines in a file from start to end, oldest to newest. | 60 | /// An iterator yielding parsed lines in a file from start to end, oldest to newest. |
| 61 | pub struct Forward<'a> { | 61 | pub struct Forward<'a> { |
| 62 | inner: std::iter::Enumerate<bstr::Lines<'a>>, | 62 | inner: std::iter::Enumerate<git_object::bstr::Lines<'a>>, |
| 63 | } | 63 | } |
| 64 | 64 | ||
| 65 | impl<'a> Iterator for Forward<'a> { | 65 | impl<'a> Iterator for Forward<'a> { |
| @@ -12,7 +12,7 @@ impl<'a> LineRef<'a> { · 11 unmodified lines | |||
| 12 | mod write { | 12 | mod write { |
| 13 | use std::io; | 13 | use std::io; |
| 14 | 14 | ||
| 15 | use bstr::{BStr, ByteSlice}; | 15 | use git_object::bstr::{BStr, ByteSlice}; |
| 16 | use quick_error::quick_error; | 16 | use quick_error::quick_error; |
| 17 | 17 | ||
| 18 | use crate::log::Line; | 18 | use crate::log::Line; |
| @@ -77,7 +77,7 @@ impl<'a> From<LineRef<'a>> for Line { · 58 unmodified lines | |||
| 77 | 77 | ||
| 78 | /// | 78 | /// |
| 79 | pub mod decode { | 79 | pub mod decode { |
| 80 | use bstr::{BStr, ByteSlice}; | 80 | use git_object::bstr::{BStr, ByteSlice}; |
| 81 | use nom::{ | 81 | use nom::{ |
| 82 | bytes::complete::{tag, take_while}, | 82 | bytes::complete::{tag, take_while}, |
| 83 | combinator::opt, | 83 | combinator::opt, |
| @@ -90,7 +90,7 @@ pub mod decode { · 6 unmodified lines | |||
| 90 | 90 | ||
| 91 | /// | 91 | /// |
| 92 | mod error { | 92 | mod error { |
| 93 | use bstr::{BString, ByteSlice}; | 93 | use git_object::bstr::{BString, ByteSlice}; |
| 94 | 94 | ||
| 95 | /// The error returned by [from_bytes(…)][super::Line::from_bytes()] | 95 | /// The error returned by [from_bytes(…)][super::Line::from_bytes()] |
| 96 | #[derive(Debug)] | 96 | #[derive(Debug)] |
| @@ -172,9 +172,9 @@ pub mod decode { · 75 unmodified lines | |||
| 172 | 172 | ||
| 173 | #[cfg(test)] | 173 | #[cfg(test)] |
| 174 | mod test { | 174 | mod test { |
| 175 | use bstr::ByteSlice; | ||
| 176 | use git_actor::{Sign, Time}; | 175 | use git_actor::{Sign, Time}; |
| 177 | use git_hash::ObjectId; | 176 | use git_hash::ObjectId; |
| 177 | use git_object::bstr::ByteSlice; | ||
| 178 | 178 | ||
| 179 | use super::*; | 179 | use super::*; |
| 180 | 180 | ||
| @@ -1,4 +1,4 @@ | |||
| 1 | use bstr::BStr; | 1 | use git_object::bstr::BStr; |
| 2 | 2 | ||
| 3 | pub use super::loose::reflog::{create_or_update, Error}; | 3 | pub use super::loose::reflog::{create_or_update, Error}; |
| 4 | 4 | ||
| @@ -3,8 +3,8 @@ use std::{ · 2 unmodified lines | |||
| 3 | path::{Path, PathBuf}, | 3 | path::{Path, PathBuf}, |
| 4 | }; | 4 | }; |
| 5 | 5 | ||
| 6 | use bstr::ByteSlice; | ||
| 7 | use git_features::fs::walkdir::DirEntryIter; | 6 | use git_features::fs::walkdir::DirEntryIter; |
| 7 | use git_object::bstr::ByteSlice; | ||
| 8 | use os_str_bytes::OsStrBytes; | 8 | use os_str_bytes::OsStrBytes; |
| 9 | 9 | ||
| 10 | use crate::{ | 10 | use crate::{ |
| @@ -1,7 +1,7 @@ | |||
| 1 | use std::convert::{TryFrom, TryInto}; | 1 | use std::convert::{TryFrom, TryInto}; |
| 2 | 2 | ||
| 3 | use bstr::BString; | ||
| 4 | use git_hash::ObjectId; | 3 | use git_hash::ObjectId; |
| 4 | use git_object::bstr::BString; | ||
| 5 | use nom::{ | 5 | use nom::{ |
| 6 | bytes::complete::{tag, take_while}, | 6 | bytes::complete::{tag, take_while}, |
| 7 | combinator::{map, opt}, | 7 | combinator::{map, opt}, |
| @@ -89,8 +89,8 @@ pub mod create_or_update { · 88 unmodified lines | |||
| 89 | path::{Path, PathBuf}, | 89 | path::{Path, PathBuf}, |
| 90 | }; | 90 | }; |
| 91 | 91 | ||
| 92 | use bstr::BStr; | ||
| 93 | use git_hash::{oid, ObjectId}; | 92 | use git_hash::{oid, ObjectId}; |
| 93 | use git_object::bstr::BStr; | ||
| 94 | 94 | ||
| 95 | use crate::store::{file, file::WriteReflog}; | 95 | use crate::store::{file, file::WriteReflog}; |
| 96 | 96 | ||
| @@ -1,8 +1,8 @@ | |||
| 1 | use super::*; | 1 | use super::*; |
| 2 | use crate::{file::WriteReflog, FullNameRef}; | 2 | use crate::{file::WriteReflog, FullNameRef}; |
| 3 | use bstr::ByteSlice; | ||
| 4 | use git_actor::{Sign, Signature, Time}; | 3 | use git_actor::{Sign, Signature, Time}; |
| 5 | use git_lock::acquire::Fail; | 4 | use git_lock::acquire::Fail; |
| 5 | use git_object::bstr::ByteSlice; | ||
| 6 | use git_testtools::hex_to_id; | 6 | use git_testtools::hex_to_id; |
| 7 | use std::{convert::TryInto, path::Path}; | 7 | use std::{convert::TryInto, path::Path}; |
| 8 | use tempfile::TempDir; | 8 | use tempfile::TempDir; |
| @@ -38,12 +38,12 @@ pub struct Transaction<'s> { · 37 unmodified lines | |||
| 38 | namespace: Option<crate::Namespace>, | 38 | namespace: Option<crate::Namespace>, |
| 39 | } | 39 | } |
| 40 | 40 | ||
| 41 | pub(in crate::store::file) fn path_to_name(path: impl Into<PathBuf>) -> bstr::BString { | 41 | pub(in crate::store::file) fn path_to_name(path: impl Into<PathBuf>) -> git_object::bstr::BString { |
| 42 | use os_str_bytes::OsStringBytes; | 42 | use os_str_bytes::OsStringBytes; |
| 43 | let path = path.into().into_raw_vec(); | 43 | let path = path.into().into_raw_vec(); |
| 44 | #[cfg(windows)] | 44 | #[cfg(windows)] |
| 45 | let path = { | 45 | let path = { |
| 46 | use bstr::ByteSlice; | 46 | use git_object::bstr::ByteSlice; |
| 47 | path.replace(b"\\", b"/") | 47 | path.replace(b"\\", b"/") |
| 48 | }; | 48 | }; |
| 49 | path.into() | 49 | path.into() |
| @@ -150,7 +150,7 @@ impl file::Store { · 149 unmodified lines | |||
| 150 | mod error { | 150 | mod error { |
| 151 | use std::{io, path::PathBuf}; | 151 | use std::{io, path::PathBuf}; |
| 152 | 152 | ||
| 153 | use bstr::BString; | 153 | use git_object::bstr::BString; |
| 154 | use quick_error::quick_error; | 154 | use quick_error::quick_error; |
| 155 | 155 | ||
| 156 | use crate::store::file; | 156 | use crate::store::file; |
| @@ -155,7 +155,7 @@ impl<'s> Transaction<'s> { · 154 unmodified lines | |||
| 155 | } | 155 | } |
| 156 | } | 156 | } |
| 157 | mod error { | 157 | mod error { |
| 158 | use bstr::BString; | 158 | use git_object::bstr::BString; |
| 159 | use quick_error::quick_error; | 159 | use quick_error::quick_error; |
| 160 | 160 | ||
| 161 | use crate::store::{file, packed}; | 161 | use crate::store::{file, packed}; |
| @@ -1,5 +1,5 @@ | |||
| 1 | use bstr::BString; | ||
| 2 | use git_hash::ObjectId; | 1 | use git_hash::ObjectId; |
| 2 | use git_object::bstr::BString; | ||
| 3 | 3 | ||
| 4 | use crate::{ | 4 | use crate::{ |
| 5 | store::{file, file::Transaction}, | 5 | store::{file, file::Transaction}, |
| @@ -339,7 +339,7 @@ impl<'s> Transaction<'s> { · 338 unmodified lines | |||
| 339 | } | 339 | } |
| 340 | 340 | ||
| 341 | mod error { | 341 | mod error { |
| 342 | use bstr::BString; | 342 | use git_object::bstr::BString; |
| 343 | use quick_error::quick_error; | 343 | use quick_error::quick_error; |
| 344 | 344 | ||
| 345 | use crate::{ | 345 | use crate::{ |
| @@ -1,6 +1,6 @@ | |||
| 1 | use std::convert::TryFrom; | 1 | use std::convert::TryFrom; |
| 2 | 2 | ||
| 3 | use bstr::{BStr, ByteSlice}; | 3 | use git_object::bstr::{BStr, ByteSlice}; |
| 4 | use nom::{ | 4 | use nom::{ |
| 5 | bytes::complete::{tag, take_while}, | 5 | bytes::complete::{tag, take_while}, |
| 6 | combinator::{map, map_res, opt}, | 6 | combinator::{map, map_res, opt}, |
| @@ -46,7 +46,7 @@ mod reference { · 45 unmodified lines | |||
| 46 | } | 46 | } |
| 47 | 47 | ||
| 48 | mod header { | 48 | mod header { |
| 49 | use bstr::ByteSlice; | 49 | use git_object::bstr::ByteSlice; |
| 50 | use git_testtools::to_bstr_err; | 50 | use git_testtools::to_bstr_err; |
| 51 | 51 | ||
| 52 | use super::Result; | 52 | use super::Result; |
| @@ -1,6 +1,6 @@ | |||
| 1 | use std::{borrow::Cow, convert::TryInto}; | 1 | use std::{borrow::Cow, convert::TryInto}; |
| 2 | 2 | ||
| 3 | use bstr::{BStr, BString, ByteSlice}; | 3 | use git_object::bstr::{BStr, BString, ByteSlice}; |
| 4 | 4 | ||
| 5 | use crate::{store::packed, PartialNameRef}; | 5 | use crate::{store::packed, PartialNameRef}; |
| 6 | 6 | ||
| @@ -1,4 +1,4 @@ | |||
| 1 | use bstr::{BString, ByteSlice}; | 1 | use git_object::bstr::{BString, ByteSlice}; |
| 2 | 2 | ||
| 3 | use crate::store::{packed, packed::decode}; | 3 | use crate::store::{packed, packed::decode}; |
| 4 | 4 | ||
| @@ -94,7 +94,7 @@ impl<'a> packed::Iter<'a> { · 89 unmodified lines | |||
| 94 | } | 94 | } |
| 95 | 95 | ||
| 96 | mod error { | 96 | mod error { |
| 97 | use bstr::BString; | 97 | use git_object::bstr::BString; |
| 98 | use quick_error::quick_error; | 98 | use quick_error::quick_error; |
| 99 | 99 | ||
| 100 | quick_error! { | 100 | quick_error! { |
| @@ -1,8 +1,8 @@ | |||
| 1 | use std::path::PathBuf; | 1 | use std::path::PathBuf; |
| 2 | 2 | ||
| 3 | use bstr::{BStr, BString}; | ||
| 4 | use filebuffer::FileBuffer; | 3 | use filebuffer::FileBuffer; |
| 5 | use git_hash::ObjectId; | 4 | use git_hash::ObjectId; |
| 5 | use git_object::bstr::{BStr, BString}; | ||
| 6 | 6 | ||
| 7 | use crate::{transaction::RefEdit, FullNameRef}; | 7 | use crate::{transaction::RefEdit, FullNameRef}; |
| 8 | 8 | ||
| @@ -1,7 +1,7 @@ | |||
| 1 | use std::fmt; | 1 | use std::fmt; |
| 2 | 2 | ||
| 3 | use bstr::BStr; | ||
| 4 | use git_hash::{oid, ObjectId}; | 3 | use git_hash::{oid, ObjectId}; |
| 4 | use git_object::bstr::BStr; | ||
| 5 | 5 | ||
| 6 | use crate::{FullName, Kind, Target, TargetRef}; | 6 | use crate::{FullName, Kind, Target, TargetRef}; |
| 7 | use std::convert::TryFrom; | 7 | use std::convert::TryFrom; |
| @@ -1,4 +1,4 @@ | |||
| 1 | use bstr::{BString, ByteVec}; | 1 | use git_object::bstr::{BString, ByteVec}; |
| 2 | 2 | ||
| 3 | use crate::{ | 3 | use crate::{ |
| 4 | transaction::{Change, LogChange, PreviousValue, RefEdit, RefLog, Target}, | 4 | transaction::{Change, LogChange, PreviousValue, RefEdit, RefLog, Target}, |
| @@ -12,7 +12,7 @@ · 11 unmodified lines | |||
| 12 | //! - errors during preparations will cause a perfect rollback | 12 | //! - errors during preparations will cause a perfect rollback |
| 13 | //! * prepared transactions are committed to finalize the change | 13 | //! * prepared transactions are committed to finalize the change |
| 14 | //! - errors when committing while leave the ref store in an inconsistent, but operational state. | 14 | //! - errors when committing while leave the ref store in an inconsistent, but operational state. |
| 15 | use bstr::BString; | 15 | use git_object::bstr::BString; |
| 16 | 16 | ||
| 17 | use crate::{FullName, Target}; | 17 | use crate::{FullName, Target}; |
| 18 | 18 | ||
| @@ -1,6 +1,6 @@ | |||
| 1 | mod line { | 1 | mod line { |
| 2 | mod write_to { | 2 | mod write_to { |
| 3 | use bstr::ByteVec; | 3 | use git_object::bstr::ByteVec; |
| 4 | use git_ref::file::log; | 4 | use git_ref::file::log; |
| 5 | 5 | ||
| 6 | #[test] | 6 | #[test] |
| @@ -159,8 +159,8 @@ mod iter { · 152 unmodified lines | |||
| 159 | } | 159 | } |
| 160 | } | 160 | } |
| 161 | mod forward { | 161 | mod forward { |
| 162 | use bstr::B; | ||
| 163 | use git_hash::ObjectId; | 162 | use git_hash::ObjectId; |
| 163 | use git_object::bstr::B; | ||
| 164 | 164 | ||
| 165 | use crate::file::log::iter::reflog; | 165 | use crate::file::log::iter::reflog; |
| 166 | 166 | ||
| @@ -191,7 +191,7 @@ mod parse { · 190 unmodified lines | |||
| 191 | mktest!(ref_tag, b"reff: hello", "\"reff: hello\" could not be parsed"); | 191 | mktest!(ref_tag, b"reff: hello", "\"reff: hello\" could not be parsed"); |
| 192 | } | 192 | } |
| 193 | mod valid { | 193 | mod valid { |
| 194 | use bstr::ByteSlice; | 194 | use git_object::bstr::ByteSlice; |
| 195 | use git_ref::file::loose::Reference; | 195 | use git_ref::file::loose::Reference; |
| 196 | use git_testtools::hex_to_id; | 196 | use git_testtools::hex_to_id; |
| 197 | 197 | ||
| @@ -1,12 +1,12 @@ | |||
| 1 | use std::convert::TryInto; | 1 | use std::convert::TryInto; |
| 2 | 2 | ||
| 3 | use bstr::ByteSlice; | 3 | use git_object::bstr::ByteSlice; |
| 4 | use git_testtools::hex_to_id; | 4 | use git_testtools::hex_to_id; |
| 5 | 5 | ||
| 6 | use crate::file::{store, store_at, store_with_packed_refs}; | 6 | use crate::file::{store, store_at, store_with_packed_refs}; |
| 7 | 7 | ||
| 8 | mod with_namespace { | 8 | mod with_namespace { |
| 9 | use bstr::BString; | 9 | use git_object::bstr::BString; |
| 10 | use git_object::bstr::ByteSlice; | 10 | use git_object::bstr::ByteSlice; |
| 11 | 11 | ||
| 12 | use crate::file::store_at; | 12 | use crate::file::store_at; |
| @@ -1,7 +1,7 @@ | |||
| 1 | mod prepare_and_commit { | 1 | mod prepare_and_commit { |
| 2 | use bstr::BString; | ||
| 3 | use git_actor::{Sign, Time}; | 2 | use git_actor::{Sign, Time}; |
| 4 | use git_hash::ObjectId; | 3 | use git_hash::ObjectId; |
| 4 | use git_object::bstr::BString; | ||
| 5 | use git_ref::file; | 5 | use git_ref::file; |
| 6 | 6 | ||
| 7 | fn reflog_lines(store: &file::Store, name: &str) -> crate::Result<Vec<git_ref::log::Line>> { | 7 | fn reflog_lines(store: &file::Store, name: &str) -> crate::Result<Vec<git_ref::log::Line>> { |
| @@ -2,10 +2,10 @@ use crate::file::{ · 1 unmodified line | |||
| 2 | store_with_packed_refs, store_writable, | 2 | store_with_packed_refs, store_writable, |
| 3 | transaction::prepare_and_commit::{committer, empty_store, log_line, reflog_lines}, | 3 | transaction::prepare_and_commit::{committer, empty_store, log_line, reflog_lines}, |
| 4 | }; | 4 | }; |
| 5 | use bstr::ByteSlice; | ||
| 6 | use git_hash::ObjectId; | 5 | use git_hash::ObjectId; |
| 7 | use git_lock::acquire::Fail; | 6 | use git_lock::acquire::Fail; |
| 8 | use git_object::bstr::BString; | 7 | use git_object::bstr::BString; |
| 8 | use git_object::bstr::ByteSlice; | ||
| 9 | use git_ref::file::ReferenceExt; | 9 | use git_ref::file::ReferenceExt; |
| 10 | use git_ref::transaction::PreviousValue; | 10 | use git_ref::transaction::PreviousValue; |
| 11 | use git_ref::{ | 11 | use git_ref::{ |
| @@ -1,6 +1,6 @@ | |||
| 1 | use std::convert::TryInto; | 1 | use std::convert::TryInto; |
| 2 | 2 | ||
| 3 | use bstr::ByteSlice; | 3 | use git_object::bstr::ByteSlice; |
| 4 | use git_ref::packed; | 4 | use git_ref::packed; |
| 5 | 5 | ||
| 6 | use crate::file::{store_at, store_with_packed_refs}; | 6 | use crate::file::{store_at, store_with_packed_refs}; |
| @@ -1,7 +1,7 @@ | |||
| 1 | mod refedit_ext { | 1 | mod refedit_ext { |
| 2 | use std::{cell::RefCell, collections::BTreeMap, convert::TryInto}; | 2 | use std::{cell::RefCell, collections::BTreeMap, convert::TryInto}; |
| 3 | 3 | ||
| 4 | use bstr::{BString, ByteSlice}; | 4 | use git_object::bstr::{BString, ByteSlice}; |
| 5 | use git_ref::{ | 5 | use git_ref::{ |
| 6 | transaction::{Change, PreviousValue, RefEdit, RefEditsExt, RefLog}, | 6 | transaction::{Change, PreviousValue, RefEdit, RefEditsExt, RefLog}, |
| 7 | PartialNameRef, Target, | 7 | PartialNameRef, Target, |
| @@ -54,7 +54,6 @@ git-protocol = { version ="^0.10.0", path = "../git-protocol", optional = true } · 53 unmodified lines | |||
| 54 | git-diff = { version ="^0.9.0", path = "../git-diff", optional = true } | 54 | git-diff = { version ="^0.9.0", path = "../git-diff", optional = true } |
| 55 | git-features = { version = "^0.16.0", path = "../git-features", features = ["progress"] } | 55 | git-features = { version = "^0.16.0", path = "../git-features", features = ["progress"] } |
| 56 | 56 | ||
| 57 | bstr = "0.2.15" | ||
| 58 | signal-hook = { version = "0.3.9", default-features = false } | 57 | signal-hook = { version = "0.3.9", default-features = false } |
| 59 | thiserror = "1.0.26" | 58 | thiserror = "1.0.26" |
| 60 | parking_lot = { version = "0.11.2", features = ["arc_lock"] } | 59 | parking_lot = { version = "0.11.2", features = ["arc_lock"] } |
| @@ -1,6 +1,6 @@ | |||
| 1 | use std::borrow::Cow; | 1 | use std::borrow::Cow; |
| 2 | 2 | ||
| 3 | use bstr::{BStr, BString, ByteSlice, ByteVec}; | 3 | use git_object::bstr::{BStr, BString, ByteSlice, ByteVec}; |
| 4 | 4 | ||
| 5 | /// An empty array of a type usable with the `git::easy` API to help declaring no parents should be used | 5 | /// An empty array of a type usable with the `git::easy` API to help declaring no parents should be used |
| 6 | pub const NO_PARENT_IDS: [git_hash::ObjectId; 0] = []; | 6 | pub const NO_PARENT_IDS: [git_hash::ObjectId; 0] = []; |
| @@ -1,7 +1,7 @@ | |||
| 1 | use std::{convert::TryInto, ops::DerefMut}; | 1 | use std::{convert::TryInto, ops::DerefMut}; |
| 2 | 2 | ||
| 3 | use bstr::BString; | ||
| 4 | use git_hash::ObjectId; | 3 | use git_hash::ObjectId; |
| 4 | use git_object::bstr::BString; | ||
| 5 | use git_odb::{Find, FindExt}; | 5 | use git_odb::{Find, FindExt}; |
| 6 | use git_ref::{ | 6 | use git_ref::{ |
| 7 | transaction::{LogChange, PreviousValue, RefLog}, | 7 | transaction::{LogChange, PreviousValue, RefLog}, |
| @@ -1,9 +1,9 @@ | |||
| 1 | use std::convert::TryInto; | 1 | use std::convert::TryInto; |
| 2 | 2 | ||
| 3 | use bstr::BString; | ||
| 4 | use git_actor as actor; | 3 | use git_actor as actor; |
| 5 | use git_hash::ObjectId; | 4 | use git_hash::ObjectId; |
| 6 | use git_lock as lock; | 5 | use git_lock as lock; |
| 6 | use git_object::bstr::BString; | ||
| 7 | use git_ref::{ | 7 | use git_ref::{ |
| 8 | transaction::{Change, LogChange, PreviousValue, RefEdit, RefLog}, | 8 | transaction::{Change, LogChange, PreviousValue, RefEdit, RefLog}, |
| 9 | FullName, PartialNameRef, Target, | 9 | FullName, PartialNameRef, Target, |
| @@ -69,6 +69,7 @@ · 68 unmodified lines | |||
| 69 | //! * [`odb`] | 69 | //! * [`odb`] |
| 70 | //! * [`pack`][odb::pack] | 70 | //! * [`pack`][odb::pack] |
| 71 | //! * [`refs`] | 71 | //! * [`refs`] |
| 72 | //! * [`bstr`][refs::bstr] | ||
| 72 | //! * [`interrupt`] | 73 | //! * [`interrupt`] |
| 73 | //! * [`tempfile`] | 74 | //! * [`tempfile`] |
| 74 | //! * [`lock`] | 75 | //! * [`lock`] |
| @@ -1,6 +1,6 @@ | |||
| 1 | /// | 1 | /// |
| 2 | pub mod log { | 2 | pub mod log { |
| 3 | use bstr::{BString, ByteSlice, ByteVec}; | 3 | use git_object::bstr::{BString, ByteSlice, ByteVec}; |
| 4 | use git_object::Commit; | 4 | use git_object::Commit; |
| 5 | 5 | ||
| 6 | use crate::commit; | 6 | use crate::commit; |
| @@ -50,7 +50,7 @@ pub mod open { · 49 unmodified lines | |||
| 50 | #[error(transparent)] | 50 | #[error(transparent)] |
| 51 | ObjectStoreInitialization(#[from] git_odb::linked::init::Error), | 51 | ObjectStoreInitialization(#[from] git_odb::linked::init::Error), |
| 52 | #[error("Cannot handle objects formatted as {:?}", .name)] | 52 | #[error("Cannot handle objects formatted as {:?}", .name)] |
| 53 | UnsupportedObjectFormat { name: bstr::BString }, | 53 | UnsupportedObjectFormat { name: git_object::bstr::BString }, |
| 54 | } | 54 | } |
| 55 | 55 | ||
| 56 | impl Repository { | 56 | impl Repository { |