Skip to content

Commit 2e68e0c

Browse files
committed
[git-odb] refactor
1 parent 936cfd3 commit 2e68e0c

File tree

11 files changed

+14
-11
lines changed

11 files changed

+14
-11
lines changed
File renamed without changes.

git-odb/src/store/alternate/parse.rs renamed to git-odb/src/alternate/parse.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
use crate::store::alternate::unquote;
1+
use crate::alternate::unquote;
22
use git_object::bstr::ByteSlice;
33
use std::{borrow::Cow, path::PathBuf};
44

5-
/// Returned as part of [`crate::store::alternate::Error::Parse`]
5+
/// Returned as part of [`crate::alternate::Error::Parse`]
66
#[derive(thiserror::Error, Debug)]
77
#[allow(missing_docs)]
88
pub enum Error {
File renamed without changes.

git-odb/src/lib.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,14 @@
1919
//! * [`store::linked::Db`]
2020
//! * A database containing various [`compound::Backends`][store::compound::Backend] as gathered from `alternates` files.
2121
pub use git_pack as pack;
22-
pub use pack::{data, Find, FindExt}; // TODO: leave it at 'git_odb::pack::data::Object` which is really what it is by now.
22+
pub use pack::{data, Find, FindExt};
23+
pub use write::Write;
24+
25+
// TODO: leave it at 'git_odb::pack::data::Object` which is really what it is by now.
2326

2427
///
2528
pub mod store;
2629

30+
pub mod alternate;
2731
///
2832
pub mod write;
29-
pub use write::Write;

git-odb/src/store/compound/init.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ pub enum Error {
1414
#[error(transparent)]
1515
Pack(#[from] pack::bundle::Error),
1616
#[error(transparent)]
17-
Alternate(#[from] Box<crate::store::alternate::Error>),
17+
Alternate(#[from] Box<crate::alternate::Error>),
1818
}
1919

2020
/// Instantiation

git-odb/src/store/linked/init.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use std::path::PathBuf;
22

3-
use crate::store::alternate;
3+
use crate::alternate;
44
use crate::store::{compound, linked};
55

66
/// The error returned by [`linked::Db::at()`]

git-odb/src/store/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
pub mod alternate;
1+
pub use sink::{sink, Sink};
2+
23
pub mod compound;
34
pub mod linked;
45
pub mod loose;
56

67
///
78
pub mod sink;
8-
pub use sink::{sink, Sink};

git-odb/tests/odb/store/alternate/mod.rs renamed to git-odb/tests/odb/alternate/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use git_odb::store::alternate;
1+
use git_odb::alternate;
22
use std::{
33
fs, io,
44
path::{Path, PathBuf},

git-odb/tests/odb/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@ pub fn hex_to_id(hex: &str) -> git_hash::ObjectId {
66
git_hash::ObjectId::from_hex(hex.as_bytes()).expect("40 bytes hex")
77
}
88

9+
pub mod alternate;
910
pub mod store;

git-odb/tests/odb/store/linked/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ mod init {
5757
use git_odb::store::linked;
5858
use std::convert::TryFrom;
5959

60+
use crate::odb::alternate::alternate;
6061
use crate::odb::store::linked::db;
61-
use crate::store::alternate::alternate;
6262

6363
#[test]
6464
fn multiple_linked_repositories_via_alternates() -> crate::Result {

0 commit comments

Comments
 (0)