Skip to content

Commit 07f7c31

Browse files
committed
Use git-object in git-odb
1 parent 605ef20 commit 07f7c31

File tree

20 files changed

+28
-441
lines changed

20 files changed

+28
-441
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

git-object/src/parsed/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1+
use crate::Time;
2+
use bstr::BStr;
13
use quick_error::quick_error;
2-
use crate::{Time};
34
use std::str;
4-
use bstr::BStr;
55

66
mod tag;
77
mod util;

git-object/src/parsed/tag.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,12 @@ impl<'data> Tag<'data> {
131131
.and_then(|(_, kind)| crate::Kind::from_bytes(kind).map_err(Into::into))?;
132132
let (_, name) = split2_at_space(name, |f, _v| f == b"tag")?;
133133
let (_, rest) = split2_at_space(tagger, |f, _v| f == b"tagger")?;
134-
(target.as_bstr(), kind, name.as_bstr(), parse_signature(rest)?)
134+
(
135+
target.as_bstr(),
136+
kind,
137+
name.as_bstr(),
138+
parse_signature(rest)?,
139+
)
135140
}
136141
_ => {
137142
return Err(Error::ParseError(

git-object/src/parsed/tests/tag.rs

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,10 @@
11
use super::fixture_bytes;
2-
use bstr::ByteSlice;
32
use crate::{
4-
Time,
5-
Sign,
6-
parsed::{
7-
self,
8-
tests::bin
9-
},
10-
Kind,
3+
parsed::{self, tests::bin},
4+
Kind, Sign, Time,
115
};
12-
use pretty_assertions::{assert_eq};
6+
use bstr::ByteSlice;
7+
use pretty_assertions::assert_eq;
138

149
#[test]
1510
fn tag_parse() {
@@ -47,7 +42,7 @@ cjHJZXWmV4CcRfmLsXzU8s2cR9A0DBvOxhPD1TlKC2JhBFXigjuL9U4Rbq9tdegB
4742
=aIns
4843
-----END PGP SIGNATURE-----
4944
"
50-
.as_bstr(),
45+
.as_bstr(),
5146
),
5247
signature: parsed::Signature {
5348
name: b"Sebastian Thiel".as_bstr(),

git-odb/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ byteorder = "1.2.3"
1919
itertools = "0.9.0"
2020
btoi = "0.4.2"
2121
bstr = { version = "0.2.13", default-features = false, features = ["std"] }
22-
nom = { version = "6.0.0-alpha1", default-features = false }
22+
git-object = { version = "0.1.0", path = "../git-object" }
2323

2424
[dev-dependencies]
2525
pretty_assertions = "0.6.1"

git-odb/src/lib.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,7 @@ extern crate quick_error;
33
#[macro_use]
44
extern crate itertools;
55

6-
mod types;
76
mod zlib;
87

98
pub mod loose;
10-
pub mod object;
119
pub mod pack;
12-
13-
pub use types::*;

git-odb/src/loose/db.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use crate::object;
1+
use git_object as object;
22

33
use hex::FromHex;
44
use std::path::PathBuf;

git-odb/src/loose/object.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
use crate::{
22
loose::{Db, HEADER_READ_COMPRESSED_BYTES, HEADER_READ_UNCOMPRESSED_BYTES},
3-
object::{self, parsed},
43
zlib,
54
};
5+
use git_object as object;
66
use hex::ToHex;
7+
use object::parsed;
78
use smallvec::SmallVec;
89
use std::{
910
fs::File, io::Cursor, io::Read, os::unix::fs::MetadataExt, path::PathBuf, str, str::FromStr,

git-odb/src/object/mod.rs

Lines changed: 0 additions & 40 deletions
This file was deleted.

git-odb/src/object/parsed/mod.rs

Lines changed: 0 additions & 47 deletions
This file was deleted.

0 commit comments

Comments
 (0)