Skip to content

Commit 16b2232

Browse files
committed
[ref #190] Make References sortable
1 parent 3d8796e commit 16b2232

File tree

3 files changed

+18
-19
lines changed

3 files changed

+18
-19
lines changed

git-ref/src/lib.rs

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -41,24 +41,7 @@ pub use raw::Reference;
4141
mod target;
4242

4343
///
44-
pub mod log {
45-
use git_hash::ObjectId;
46-
use git_object::bstr::BString;
47-
48-
/// A parsed ref log line that can be changed
49-
#[derive(PartialEq, Eq, Debug, Hash, Ord, PartialOrd, Clone)]
50-
#[cfg_attr(feature = "serde1", derive(serde::Serialize, serde::Deserialize))]
51-
pub struct Line {
52-
/// The previous object id. Can be a null-sha to indicate this is a line for a new ref.
53-
pub previous_oid: ObjectId,
54-
/// The new object id. Can be a null-sha to indicate this ref is being deleted.
55-
pub new_oid: ObjectId,
56-
/// The signature of the currently configured committer.
57-
pub signature: git_actor::Signature,
58-
/// The message providing details about the operation performed in this log line.
59-
pub message: BString,
60-
}
61-
}
44+
pub mod log;
6245

6346
///
6447
pub mod peel;

git-ref/src/log.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
use git_hash::ObjectId;
2+
use git_object::bstr::BString;
3+
4+
/// A parsed ref log line that can be changed
5+
#[derive(PartialEq, Eq, Debug, Hash, Ord, PartialOrd, Clone)]
6+
#[cfg_attr(feature = "serde1", derive(serde::Serialize, serde::Deserialize))]
7+
pub struct Line {
8+
/// The previous object id. Can be a null-sha to indicate this is a line for a new ref.
9+
pub previous_oid: ObjectId,
10+
/// The new object id. Can be a null-sha to indicate this ref is being deleted.
11+
pub new_oid: ObjectId,
12+
/// The signature of the currently configured committer.
13+
pub signature: git_actor::Signature,
14+
/// The message providing details about the operation performed in this log line.
15+
pub message: BString,
16+
}

git-ref/src/raw.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use git_hash::ObjectId;
33
use crate::{FullName, Target};
44

55
/// A fully owned backend agnostic reference
6-
#[derive(Debug, Clone)]
6+
#[derive(PartialEq, Eq, Debug, Hash, Ord, PartialOrd, Clone)]
77
pub struct Reference {
88
/// The path to uniquely identify this ref within its store.
99
pub name: FullName,

0 commit comments

Comments
 (0)